Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::regex on to match in the middle of a string
From: Conoscenza Silente (abruzzoforteegentile_at_[hidden])
Date: 2010-03-12 03:47:16


Hi
I thank you all for your kind help!
Everything works fine using boost::regex_search
I am also sorry because I didn't realize that my regex was incorreect
because of \t
Have a nice day to everybody
CS

On Fri, Mar 12, 2010 at 5:27 AM, Eric Niebler <eric_at_[hidden]> wrote:

>
> On 3/12/2010 4:54 AM, Conoscenza Silente wrote:
>
>> Hi All
>> I am newbie to boost::regex.
>> I have a string including multiple new lines characters in it like the
>> one below.
>>
>> "this is a big string\nthat I would like\ntoParse here:
>> WORD_TO_FIND=Ciao\nin the middle"
>>
>> I tried the following regex but it doesn't match.
>>
>> boost::regex ln0("WORD_TO_FIND=\t(?<SYMBOL>\\w+).+", boost::regex::perl );
>>
>> Do you know what is the option and how to set it up
>> to enable the matching for an entire string and not line by line?
>> Thanks
>>
>
> Are you using the regex_match algorithm? That only succeeds if the pattern
> matches the whole input. You should be using regex_search.
>
> Also, which version of Boost are you using? I think Boost.Regex only got
> support for named captures very recently. John can correct me if I'm wrong.
>
> --
> Eric Niebler
> BoostPro Computing
> http://www.boostpro.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