
8 Feb
2006
8 Feb
'06
5:48 p.m.
// I would expect this to not match due to the 'w'. // Why does it match? cout << regex_match("\xF8p\x2Aqfw\x0DPFFF", reg_exp) << endl;
I believe the \x2A character is a '*' right? If so the compiler converts \x2A to a * so the regex engine sees a ".*". If you double up those escapes and use "\\x2A" then the regex engine will parse the escape rather than the compiler, and so it won't be interpreted as a quantifier anymore. This one had me fooled for a while BTW ;-) John.