Boost logo

Boost Users :

Subject: Re: [Boost-users] Regular Expression (vers. 1.34.1)
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-05-05 12:03:46


> Actual not. The first level of backslashes is
> processed by C++. The regex library never sees
> them. This pattern with match
> x/filename-txt, since . is a wild card.

>Oh so it's just a case that it matches string "./File.txt".
>
>So basically I have to double backslash everytime?

Everytime you want the regex engine to see a "\" you have to put "\\" in
your string since the first \ gets swallowed by the C++ parser and doesn't
appear in the actual string placed in your program (of course if the regular
expressions were read in from an extern text file or something then this
wouldn't be the case).

HTH, 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