#10512 closed Bugs (wontfix)
Syntax error in Regex not detected
Reported by: | 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 , 8 years ago
comment:2 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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 , 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 , 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.
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.