From: Jason Dossett (jdossett_at_[hidden])
Date: 2001-01-16 12:36:03
I recently downloaded the latest boost release (great set of
libraries!) and built the regex lib for vc++.
I'm using the following to perform a regex match:
if( boost::regex_match( line, match, boost::regex( "\\[(.+?\\]" ) ) )]
do_stuff_with( match );
(code simplified for the example)
The line I am performing the match on is something like this:
The regex_match is returning this for the submatch:
I would think that the '?' would force the regex to be non-greedy,
and only get what was between the .
I tested this with perl, and the same regexp resulted in this for the
Is this a known problem with regex? Or am I overlooking something
Thanks for your time.
Sr. Software Engineer
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk