Boost logo

Boost Users :

Subject: Re: [Boost-users] Abort error with simple Boost regexp
From: Anthony Foiani (tkil_at_[hidden])
Date: 2011-09-15 23:40:01


V A <gmanony_at_[hidden]> writes:

> 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*...


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net