Boost logo

Boost :

From: Benzinger, Ralph (ralph.benzinger_at_[hidden])
Date: 2004-04-07 04:28:27


Hello,

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)[0].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 iterator approach.

Any ideas or comments?

Thanks,
Ralph


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk