Opened 9 years ago
Closed 9 years ago
#9289 closed Bugs (invalid)
Boost1.54/regex doesn't throw exception on invalid pattern (regression)
| Reported by: | Owned by: | John Maddock | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | regex |
| Version: | Boost 1.54.0 | Severity: | Regression |
| Keywords: | Cc: |
Description
#include <boost/regex.hpp>
main () {
boost::regex("{notclosed");
}
Above code is essentially part of source-highlight test-suite. Above code is expected to throw boost::regex_error exception. And it did so up-to boost 1.53, with boost 1.54 it no longer throws that.
Expected output
$ ./a.out
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::regex_error> >'
what(): Invalid content of repeat range. The error occurred while parsing the regular expression: '{>>>HERE>>>notclosed'.
Aborted (core dumped)
$ echo $?
134
Actual with boost1.54
$ ./a.out $ echo $? 0
Change History (4)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Never mind, this is not a bug, but rather a bugfix.
Adjusted test:
#include <boost/regex.hpp>
main () {
boost::regex("{notclosed");
}
fails with all boosts correctly. Please close.
comment:3 by , 9 years ago
- correction
#include <boost/regex.hpp>
main () {
boost::regex("[");
}
fails everywhere.
comment:4 by , 9 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

I guess it's because PERL in the default parser? in that case above is bugfix for https://svn.boost.org/trac/boost/ticket/8569