
24 Apr
2006
24 Apr
'06
3:54 p.m.
Brad Barber wrote:
If my code contains the following regexp,
const boost::tregex non_printables(__T("[^\0x21-\0x7E]+"));
Don't forget that your pattern is scanned first by the C++ compiler. In this case, this means that \0x21 is never seen by the RegExp engine; instead, it sees a NUL character (ASCII 0) followed by "x21". NUL is not valid in any pattern and thus an exception is thrown. Use double backslashes to get a backslash through to the engine. Sebastian Redl