The boost::regex class is crashing when I construct it with some regular expressions. For example: "(value|default)[^}]*\{" will crash and "value|default" does not. Is this a bug, or am I doing something wrong? I am running gcc2.96 and boost1.30.2. I have attached an example src including Makefile. Thanks in advance, Paul
Hi Paul
I tried your example on VC++. It does not crash but throws
boost::bad_expression with message: "Unmatched \{". I think that you should
modify your pattern to "(value|default)[^}]*\\{". Otherwise the backslash
is ignored (VC++ gives a warning about that) and regex treats '{' as the
start of the bounds operator "{}" - as result a closing '}' is expected.
Stefan
----- Original Message -----
From: "Paul Scruby"
The boost::regex class is crashing when I construct it with some regular expressions. For example: "(value|default)[^}]*\{" will crash and "value|default" does not.
Is this a bug, or am I doing something wrong? I am running gcc2.96 and boost1.30.2. I have attached an example src including Makefile.
Thanks in advance,
Paul
---------------------------------------------------------------------------- ----
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hey Stefan, You're right my regular expression was not escaped properly! I have put my code inside some try and catch braces, and everything works fine. BTW, I have had some problems with exceptions in gcc2.96 (not related to boost) linking dynamic libraries, but they seem to catch ok with the -fsjlj-exceptions compiler flag. Many thanks, Paul
Hi Paul
I tried your example on VC++. It does not crash but throws boost::bad_expression with message: "Unmatched \{". I think that you should modify your pattern to "(value|default)[^}]*\\{". Otherwise the backslash is ignored (VC++ gives a warning about that) and regex treats '{' as the start of the bounds operator "{}" - as result a closing '}' is expected.
Stefan
----- Original Message ----- From: "Paul Scruby"
To: Sent: Sunday, November 16, 2003 8:37 PM Subject: [Boost-users] regex problems The boost::regex class is crashing when I construct it with some regular expressions. For example: "(value|default)[^}]*\{" will crash and "value|default" does not.
Is this a bug, or am I doing something wrong? I am running gcc2.96 and boost1.30.2. I have attached an example src including Makefile.
Thanks in advance,
Paul
---------------------------------------------------------------------------- ----
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
The boost::regex class is crashing when I construct it with some regular expressions. For example: "(value|default)[^}]*\{" will crash and "value|default" does not.
The one that's "crashing" is not a valid regular expression - so I hope that you are catching the exception that gets thrown? Otherwise it will "crash" due to the unhandled exception ;-) John.
participants (3)
-
John Maddock
-
Paul Scruby
-
Stefan Shishkov