
16 Dec
2008
16 Dec
'08
5:52 a.m.
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