aboutsummaryrefslogtreecommitdiff
path: root/cutl/re/re.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cutl/re/re.cxx')
-rw-r--r--cutl/re/re.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/cutl/re/re.cxx b/cutl/re/re.cxx
index 8e46d59..f2a6a67 100644
--- a/cutl/re/re.cxx
+++ b/cutl/re/re.cxx
@@ -41,7 +41,10 @@ namespace cutl
typedef tr1::basic_regex<C> regex_type;
impl () {}
- impl (string_type const& s): r (s, tr1::regex_constants::ECMAScript) {}
+ impl (string_type const& s, bool icase)
+ : r (s,
+ tr1::regex_constants::ECMAScript |
+ (icase ? tr1::regex_constants::icase : 0)) {}
impl (regex_type const& r): r (r) {}
regex_type r;
@@ -93,14 +96,16 @@ namespace cutl
template <>
void basic_regex<char>::
- init (string_type const* s)
+ init (string_type const* s, bool icase)
{
try
{
if (impl_ == 0)
- impl_ = s == 0 ? new impl : new impl (*s);
+ impl_ = s == 0 ? new impl : new impl (*s, icase);
else
- impl_->r = *s;
+ impl_->r.assign (*s,
+ tr1::regex_constants::ECMAScript |
+ (icase ? tr1::regex_constants::icase : 0));
}
catch (tr1::regex_error const& e)
{
@@ -110,14 +115,16 @@ namespace cutl
template <>
void basic_regex<wchar_t>::
- init (string_type const* s)
+ init (string_type const* s, bool icase)
{
try
{
if (impl_ == 0)
- impl_ = s == 0 ? new impl : new impl (*s);
+ impl_ = s == 0 ? new impl : new impl (*s, icase);
else
- impl_->r = *s;
+ impl_->r.assign (*s,
+ tr1::regex_constants::ECMAScript |
+ (icase ? tr1::regex_constants::icase : 0));
}
catch (tr1::regex_error const& e)
{