
3 Jan
2010
3 Jan
'10
11:54 a.m.
Compilation fails with the following error:
contact.cpp: In member function ‘virtual bool Contact::response()’: contact.cpp:48: error: unknown escape sequence '\s'
The regex works fine with the \s removed (but of course replaces all spaces with underscores).
You need to use \\s as the escape is processed first by the compiler, and then by the regex engine, so a string literal of "\\" produces a single \ to be passed to the regex engine. John.