8 Feb
2006
8 Feb
'06
9:11 a.m.
Hi,
I'm new to regex. This is basically what I was trying.
#include <iostream> #include
int main() { std::string input = "sand._12"; boost::regex reg(".*\._[0-9]+");
Hi In C++, you need to double your escape characters, so that in order to pass '.*\._[0-9]+' to the RE, you need to pass '.*\\._[0-9]+' to the compiler. With the string that you use, the compiler will strip the sole backslash, and the RE will get '.*._[0-9]+', which isn't what you want. A+ Paul Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn)