diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index 0da43e30..f5eb3feb 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -1268,6 +1268,9 @@ bool perl_matcher::unwind_fast_dot_repeat(bool }while((count < rep->max) && (position != last) && !can_start(*position, rep->_map, mask_skip)); } + // remember where we got to if this is a leading repeat: + if((rep->leading) && (count < rep->max)) + restart = position; if(position == last) { // can't repeat any more, remove the pushed state: