Abort error with simple Boost regexp

Hi, While running the following program using boost 1.26.0, I get an abort error. Any idea why? Thank you. test program ------ int main( int argc, char **argv ) { string yexp = ".*{"; boost::regex expression( yexp.c_str() ); return 0; } // main() Here is the gdb trace: ------ #0 0x618e7ecc in kill () from /usr/lib32/compat/libc.so.4 #1 0x6192c525 in abort () from /usr/lib32/compat/libc.so.4 #2 0x6187d8c8 in __default_terminate () from /home/y/lib/libstdc++.so.2.10 #3 0x6187d8e5 in __terminate () from /home/y/lib/libstdc++.so.2.10 #4 0x6187e1c0 in throw_helper (eh=0x61893c60, pc=0x1002865, my_udata=0xffffdbf0, offset_p=0xffffdbec) from /home/y/lib/libstdc++.so.2.10 #5 0x6187e375 in __throw () from /home/y/lib/libstdc++.so.2.10 #6 0x01002a4b in main (argc=1, argv=0xffffdd24) at testBoost.cc:18

V A
While running the following program using boost 1.26.0, I get an abort error. Any idea why?
string yexp = ".*{";
Curly braces are special in regexps: they must be paired. You probably meant this: ".*\\{" (It is also probable that, if you really did mean special curly braces, then putting them after the asterisk quantifier is a bad idea.) The abort was probably caused by an unhandled exception. Try catching all exceptions, e.g.: try { // do whatever } catch ( const std::exception & e ) { std::clog << "caught standard exception: " << e.what() << std::endl; } catch ( const std::string & s ) { std::clog << "caught c++ string exception: " << s << std::endl; } catch ( const char * s ) { std::clog << "caught C string exception: " << s << std::endl; } catch ( ... ) { std::clog << "caught unexpected exception" << std::endl; } Hope this helps. Best regards, Tony p.s. Boost 1.26? Really? That's *ancient*...
participants (2)
-
Anthony Foiani
-
V A