Opened 9 months ago

#13493 new Bugs

boost::regex doesn't accept a regular expression anymore

Reported by: sebastian.panek@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.66.0 Severity: Regression
Keywords: Cc: Sebastian, Panek

Description

I recently switched from Boost 1.61 to Boost 1.66 and discovered the following problem with boost::regex in 1.66: A regular expression is recognized as erroneous, i. e. after construction boost::regex::status() returns a value != 0, but the same expression was accepted in previous boost versions. Calling boost::regex_search() with such a erroneous boost::regex object leads to a crash.

The expression is:

([0-9]*)\.([0-9]*)(\.([0-9]*)(\.([0-9]*))?)?

My C++ code looks as follows:

static const boost::regex versionRegex( "([0-9]*)\\.([0-9]*)(\\.([0-9]*)(\\.([0-9]*))?)?" );
assert( versionRegex.status() == 0 && "the regular expression must be valid" );

After switching the boost version to 1.66 the assertion above fails.

Change History (0)

Note: See TracTickets for help on using tickets.