|
Boost Users : |
Subject: Re: [Boost-users] Regular Expression (vers. 1.34.1)
From: Salvatore Benedetto (salvatore.benedetto_at_[hidden])
Date: 2010-05-05 10:31:09
On 5 May 2010 16:23, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> AMDG
>
> Salvatore Benedetto wrote:
>>
>> On 5 May 2010 16:10, Nat Goodspeed <nat_at_[hidden]> wrote:
>>
>>>
>>> This might (or might not) work better:
>>> "\\.\\/\\w+(\\.txt)"
>>>
>>
>> Indeed I was missing a backslash.
>>
>> The following worked as I expected.
>>
>> std::string expression("\.\/\\w+(\.txt)");
>>
>
> 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?
Thanks again,
S.
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