13 Dec
2005
13 Dec
'05
2:35 p.m.
I have a regular expression that compiles & matches as expected, viz: boost::regex rxBlah("([a-z](_?[a-z0-9])*)_dvs", boost::regex_constants::icase); I would like to make the inner parentheses non-marking, so I modified the regex as below: boost::regex rxBlah("([a-z](?:_?[a-z0-9])*)_dvs", boost::regex_constants::icase); However, this throws a bad_expression exception on compilation, with the message "Invalid preceding regular expression". I've tested the second regex in another regex tool (The Regex Coach, http://weitz.de/regex-coach/) and it was accepted, and performed as expected - when presented with the text "a_dvs", it showed one capture, the text "a". So - help, what have I done wrong? Stuart Dootson