Boost logo

Boost Users :

Subject: Re: [Boost-users] [Regex] Search Substring
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-03-08 12:45:26


On 08/03/2011 18:09, S Nagre wrote:
>
> Thanks a lot John for this, I changed my code to this and it worked..
>
> boost::smatch what;
> while (boost::regex_search(startOffset ,endOffset , what, expression))
> {
> int32 pos = what.position();
> int32 len = what.length();
> }
>
> However, could you tell me how to do this if my input string is "Hello
> World, Hello".
> that is the reason I am using a while loop instead of an if since my
> input string can contain more than 1 search string.

I'd say

startOffset += pos + len;


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