title: RTF Tags removal by regex crashes
body: <p>I am using C++ VS 2008 to strip RTF tags to make a search in the RTF text only.</p>
  
  <p>The RTF text I get from <code>CRichTextEdit</code> into <code>CString</code> works just fine.
  Here how I try to remove the tags:</p>
  
  <pre><code>std::tr1::cmatch res;
  std::string str = note;
  const std::tr1::regex rx("({\\)(.+?)(})|(\\)(.+?)(\b)");
  std::string replacement = "";
  std::string result = std::tr1::regex_replace(str,rx,replacement);
  
  CString strSearchText = result.c_str();
  </code></pre>
  
  <p>The line 3 crashes on the pattern above.  A simple pattern for a text replacement works just fine: Ex replace <code>"fast"</code> from <code>"fast fox"</code> with an emplty string.  the crash message is here:  </p>
  
  <blockquote>
    <p>First-chance exception at 0x7622fbae in ICView.exe: Microsoft C++ exception: std::tr1::regex_error at memory location 0x0012ee20..<br>
       First-chance exception at 0x7622fbae in ICView.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..<br>
       Unhandled exception at 0x7622fbae in ICView.exe: Microsoft C++ exception: std::tr1::regex_error at memory location 0x0012ee20..</p>
  </blockquote>