Folks, desperately need your help. I am using C++ VS 2008 to strip RTF tags to make search in the RTF text only.
The rtf text I get from CRichTextEdit into CString and it works just fine. Here how I try to remove the tags:
1 std::tr1::cmatch res;
2 std::string str = note;
3 const std::tr1::regex rx("({\\)(.+?)(})|(\\)(.+?)(\b)");
4 std::string replacement = "";
5 std::string result = std::tr1::regex_replace(str,rx,replacement);
6
7 CString strSearchText = result.c_str();
The line 3 crashes on the pattern above. A simple pattern for a text replacement works just fine: Ex replace "fast" from "fast fox" with an emplty string. the crash message is here:
First-chance exception at 0x7622fbae in ICView.exe: Microsoft C++ exception: std::tr1::regex_error at memory location 0x0012ee20..
First-chance exception at 0x7622fbae in ICView.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
Unhandled exception at 0x7622fbae in ICView.exe: Microsoft C++ exception: std::tr1::regex_error at memory location 0x0012ee20..
thanks a lot. Val