From: John Maddock (john_at_[hidden])
Date: 2004-04-07 06:15:10
> Is it just me or does regex_grep return overlapping matches when using the
match_posix flag? More specifically, grepping regex "a+" over text "-aaa-"
will find matches "aaa", "aa", and "a" at offsets 1, 2, and 3, respectively.
This does not happen using the match_perl flag. I've confirmed this on NT
and Linux platforms.
> The problem seems to be somewhere near perl_matcher::match_all_states(),
where the inner if(!(this->*proc)()) statement is entered multiple times and
thus indirectly sets (*m_presult).second to an incorrect value, leading
to an incorrect restart point.
> I know that regex_grep is deprecated, but I still prefer it over the
> Any ideas or comments?
Yep, there's a fix going into cvs now, the patch is:
RCS file: /cvsroot/boost/boost/boost/regex/v4/perl_matcher_common.hpp,v
retrieving revision 1.18
diff -r1.18 perl_matcher_common.hpp
< search_base = position = (*m_presult).second;
--- > search_base = position = m_result.second; Thanks for reporting that one, John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk