30 Oct
2010
30 Oct
'10
11:54 p.m.
Hi there, I was under the expression that a regular expression which works with perl would also work with boost::regex. The following very simple test program doesn't work: if( boost::regex_match( "query", boost::regex( "q[u]" ))) { cout << "match" << endl; } else { cout << "no match" << endl; } whereas the perl equivalent works just fine: $text = "query"; if($text =~ m/q[u]/) { print "match!\n"; } else { print "no match\n"; } Meaning the perl code matches the regex inside $text and the boost::regex doesn't match. Can someone tell me what's wrong here with my thinking? And yes, I'm very new to regex overall. ;-) Thanks, Christian