Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10512 closed Bugs (wontfix)

Syntax error in Regex not detected

Reported by: martin.grieb@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.56.0 Severity: Regression
Keywords: Cc:

Description

The regex "A{2" is not detected as syntactically incorrect. It matches the string "03A{2B6FC7". Other bad regexes (like "A{2}}") raise an error correctly.

This worked in 1.55.

Change History (4)

comment:1 by martin.grieb@…, 8 years ago

This was broken in 84371 . I regard this as bug, not as feature. "A}2" still raises an error as it should (but which is not consistent).

The documentation mentions {} as special characters, the "ignore error and treat this as literal string" behavior is not documented.

comment:2 by John Maddock, 8 years ago

Resolution: wontfix
Status: newclosed

Sigh... we do what Perl does, this was changed in response to https://svn.boost.org/trac/boost/ticket/8569 even though I would personally prefer this to raise an error.

I've updated the docs, and changed trailing }'s to also be treated as literals.

comment:3 by martin.grieb@…, 8 years ago

What about ECMAScript mode which is identical to Perl mode? Is the Perl behavior valid in ECMAScript mode? Would splitting ECMAScript mode from Perl mode (with different error handling as only difference) be a possible solution?

comment:4 by John Maddock, 8 years ago

To be honest we don't really support ECMAScript as such (except as a subset of Perl). It would take quite a bit of work to figure out what needs to be disabled for a "strict" ECMAScript mode.

Note: See TracTickets for help on using tickets.