summaryrefslogtreecommitdiff
path: root/src/mask.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-07 08:32:44 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-07 08:34:13 -0500
commitc8641a6de65670b8833992c94c51a586a6434a74 (patch)
treeeb59642cd3296a98ec4c7a73ca319b1c57c2f7ad /src/mask.cc
parent95a068f5e4b0e5c06fd9824f7f999248e28fee7b (diff)
downloadfork-ledger-c8641a6de65670b8833992c94c51a586a6434a74.tar.gz
fork-ledger-c8641a6de65670b8833992c94c51a586a6434a74.tar.bz2
fork-ledger-c8641a6de65670b8833992c94c51a586a6434a74.zip
Added support for Boost.Regex w/ ICU
This allows for correct searching of UTF-8 encoded strings, such as lower-case versions of Russian words to find mixed-case words.
Diffstat (limited to 'src/mask.cc')
-rw-r--r--src/mask.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mask.cc b/src/mask.cc
index 135f6669..c1e66ced 100644
--- a/src/mask.cc
+++ b/src/mask.cc
@@ -43,7 +43,11 @@ mask_t::mask_t(const string& pat) : expr()
mask_t& mask_t::operator=(const string& pat)
{
- expr.assign(pat.c_str(), regex::perl | regex::icase);
+#if defined(HAVE_BOOST_REGEX_UNICODE)
+ expr = boost::make_u32regex(pat.c_str(), boost::regex::perl | boost::regex::icase);
+#else
+ expr.assign(pat.c_str(), boost::regex::perl | boost::regex::icase);
+#endif
VERIFY(valid());
return *this;
}