Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2006-04-13 13:03:27


> In the (^([a-z]:\\?) I want to make the last \ optionnal not to have
> a literal ?.
>
> Should I change this to: "(^([a-z]:\\\?)" ?

The the one thing you should not do :-)

If the string is embedded in your program as a string literal, then the
compiler will replace each \\ with \ before regex sees it, so "\\?" matches
a literal "?" and "\\\\?" is an optional backslash.

Of course all your other backslashes may need doubling up as well if you
intend them to be literal backslashes rather than regex-escapes :-)

John.


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