Subject: Re: [Boost-users] Regular Expression (vers. 1.34.1)
From: Nat Goodspeed (nat_at_[hidden])
Date: 2010-05-05 10:10:56


Salvatore Benedetto wrote:

> Here is the expression I'm using.
>
> boost::regex regularExpression;
> std::string expression("\.\/\w+(\.txt)");

I haven't reviewed the syntax of the regular expression or the code
you're using to match it. But I can tell you that your backslashes are
not being passed to the library as you expect because of the rules of
ordinary C++ string literals.

This might (or might not) work better:
"\\.\\/\\w+(\\.txt)"