Boost logo

Boost :

Subject: [boost] [Regex] Why doesn't this pattern match?
From: Vitalij Gotovskij (Vitalij.gotovskij_at_[hidden])
Date: 2009-12-07 09:37:45


can, please, somebody explain, why this code doesn't work?

   std::wstring str = L"Line \\n line \\n line \\n";
   std::wstring result = L"";
   const boost::u32regex e = boost::make_u32regex(L"\\n");
   std::wstring newText = L"\n";
   result = boost::u32regex_replace(str, e, newText);

After launching result == str... :(((

I also tryed with const boost::u32regex e = boost::make_u32regex("\\n");
but result was the same...

I am using Regex from bost 1.37.0 compilled with ICU 4.2.1
Visual Studio 2008.

Boost list run by bdawes at, gregod at, cpdaniel at, john at