Opened 13 years ago

Closed 13 years ago

#3321 closed Bugs (worksforme)

Boost::regex throws invalid execption when assigning match text

Reported by: Raymond Chandler III <raymond.chandler.ctr@…> Owned by: John Maddock
Milestone: Boost 1.40.0 Component: regex
Version: Boost 1.38.0 Severity: Problem
Keywords: Regex \{ \[ \] \} assign Cc:

Description

Boost::regex::assign throws an exception on "[A-Za-z_:,=\t\{\[\]\}]" when it should not. The offending text within the text(heh) is "[SomeMatchText\{\[\]\}]SomeMatchText]". It does not matter where in the text "\{\[\]\}" is located it will always throw an exception if provided in that order.

However, if you do "[\}SomeMatchText\{\[\]]" it will not throw an exception. I haven't tried other split combinations.

This bug was noticed in version 1.38, the changelogs do not seem to indicate this bug being fixed.

Change History (1)

comment:1 by anonymous, 13 years ago

Resolution: worksforme
Status: newclosed

Works for me, note that the escapes need to be doubled up if the string is embedded in the source file. For example:

boost::regex e("[A-Za-z_:,=\\t\\{\\[\\]
}]");

Remember that the compiler gobbles up the first escape.

Please reopen if you have a test case.

Note: See TracTickets for help on using tickets.