Boost logo

Boost Users :

From: Bogdan Harjoc (harjoc_at_[hidden])
Date: 2005-04-06 10:16:51


Thanks for the replies !

I noticed I'd forgotten to escape the backslashes only after having
posted. I tried cancelling the post but it obviously didn't work.

Again, thanks and sorry for the mess.

On Apr 5, 2005 5:34 PM, Eric Niebler <eric_at_[hidden]> wrote:
> Bogdan Harjoc wrote:
> > Hi,
> >
> > I've looked at replacing the pcre library with boost regex,mainly
> > because the C++ interface seems more usable than the plain C functions
> > from pcre.
> >
> > The trouble is, I'm wasn't able to adjust regular expressions to the
> > format boost regex uses. For instance, while pcre and others seem to
> > like the expression "\?", boost throws bad_expression. The same goes
> > for "\(", "\+" and others I'm using.
> >
>
> You need to escape the escape. "\\?" will match a literal '?' character.
> Ditto for "\\(" and "\\+". That's because the C++ compiler will eat one
> level of escape even before the regex engine sees it.
>
> Surely you have to use an extra slash with PCRE, too, right?
>
> --
> Eric Niebler
> Boost Consulting
> www.boost-consulting.com
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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