Boost logo

Boost Users :

Subject: Re: [Boost-users] [xpressive] Overlapping match results?
From: Eric Niebler (eric_at_[hidden])
Date: 2008-12-16 00:52:14


Dave Jenkins wrote:
> Is there a way to get overlapping match results from Xpressive? For
> example, when searching for "aa" in the string "aaaa", I want three
> results [as]as, a[aa]a, and aa[aa]. Currently, I'm only getting the two
> non-overlapping results [aa]aa and aa[aa].
<snip>

The regex iterators only give non-overlapping results. If you want to
find overlapping results, you can use the regex_search() algorithm
iteratively, specifying the start position as what[0].first+1 instead of
what[0].second.

HTH,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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