From c4d13296e6e770e92abc4fc28d53e26576c9a309 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 19 May 2006 13:06:19 +0000 Subject: [PATCH] Fix for non-greedy repeats and partial matches not working correctly in all cases. [SVN r34027] --- include/boost/regex/v4/perl_matcher_non_recursive.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index 791c5d93..c055b383 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -1066,6 +1066,8 @@ bool perl_matcher::unwind_slow_dot_repeat(bool { // can't repeat any more, remove the pushed state: destroy_single_repeat(); + if((m_match_flags & match_partial) && (position == last) && (position != search_base)) + m_has_partial_match = true; if(0 == (rep->can_be_null & mask_skip)) return true; } @@ -1118,6 +1120,8 @@ bool perl_matcher::unwind_fast_dot_repeat(bool { // can't repeat any more, remove the pushed state: destroy_single_repeat(); + if((m_match_flags & match_partial) && (position == last) && (position != search_base)) + m_has_partial_match = true; if(0 == (rep->can_be_null & mask_skip)) return true; } @@ -1182,6 +1186,8 @@ bool perl_matcher::unwind_char_repeat(bool r) { // can't repeat any more, remove the pushed state: destroy_single_repeat(); + if((m_match_flags & match_partial) && (position == last) && (position != search_base)) + m_has_partial_match = true; if(0 == (rep->can_be_null & mask_skip)) return true; } @@ -1246,6 +1252,8 @@ bool perl_matcher::unwind_short_set_repeat(bool { // can't repeat any more, remove the pushed state: destroy_single_repeat(); + if((m_match_flags & match_partial) && (position == last) && (position != search_base)) + m_has_partial_match = true; if(0 == (rep->can_be_null & mask_skip)) return true; } @@ -1311,6 +1319,8 @@ bool perl_matcher::unwind_long_set_repeat(bool { // can't repeat any more, remove the pushed state: destroy_single_repeat(); + if((m_match_flags & match_partial) && (position == last) && (position != search_base)) + m_has_partial_match = true; if(0 == (rep->can_be_null & mask_skip)) return true; }