Boost logo

Boost Users :

From: Stuart Dootson (stuart.dootson_at_[hidden])
Date: 2005-12-13 09:35:03


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net