Boost logo

Boost :

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:

char line[4096];
cmatch match;

if( boost::regex_match( line, match, boost::regex( "\\[(.+?\\]" ) ) )]
   do_stuff_with( match[1] );

(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.

Jason Dossett
Sr. Software Engineer
SEP, Inc.

Boost list run by bdawes at, gregod at, cpdaniel at, john at