
What should be the behavior of a regex::smatch whenever the regex::expression you are trying to match is not a well formed regex expression? With the current implementation is crush and burn. I do not know what is boost policy on this matter, but I think this is not desirable. Lucas/

What should be the behavior of a regex::smatch whenever the regex::expression you are trying to match is not a well formed regex expression? With the current implementation is crush and burn. I do not know what is boost policy on this matter, but I think this is not desirable.
1) If you try and compile an invalid expression you get a boost::bad_expression exception thrown, it's up to you to handle it. 2) If you pass an invalid (or empty) regular expression object to one of the regex algorithms, then that's a (documented) precondition failure, and you get a std::invalid_argument exception thrown, and it's up to you to handle it. 3) The smatch object should be untouched after the above exception is thrown, that's hardly "crash and burn". John.

"John Maddock" <john@johnmaddock.co.uk> wrote in message news:025a01c497f8$8134eef0$fce30352@fuji...
What should be the behavior of a regex::smatch whenever the regex::expression you are trying to match is not a well formed regex expression? With the current implementation is crush and burn. I do not know what is boost policy on this matter, but I think this is not desirable.
1) If you try and compile an invalid expression you get a boost::bad_expression exception thrown, it's up to you to handle it. 2) If you pass an invalid (or empty) regular expression object to one of the regex algorithms, then that's a (documented) precondition failure, and you get a std::invalid_argument exception thrown, and it's up to you to handle it. 3) The smatch object should be untouched after the above exception is thrown, that's hardly "crash and burn".
I think that the behavior you specify is perfect, unfortunate this is not true with VC 6.0 Lucas/
John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
John Maddock
-
Lucas Galfaso