problem with withespace in regular expression
I have the following simple code:
std::string str = "This is a simple test"
std::tr1::cmatch res;
std::tr1::regex rx("a(\\s+)sim");
std::tr1::regex_search(str.c_str(), res, rx);
which compiles correctly but fails at execution time at the 3rd line with the following message:
Debug Assertion Failed!
Program test.exe
File f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c line 1511
Expression: _CrtIsValidHeappointer(pUserData)
Every other expression that does not contain \\s+ executes properly, but this one does not. I have tried the same with boost and it has teh same problem.
Any idea what could be wrong?
Last edited by menashe; August 17th, 2009 at 08:40 AM..
|