[ID 20000701.002] Regular Expressions Not Unsetting $1 Vars When Backtracking
Hugo van der Sanden [Tue, 11 Jul 2000 12:44:50 +0000 (13:44 +0100)]
Message-Id: <200007111144.MAA04446@crypt.compulink.co.uk>

p4raw-id: //depot/cfgperl@6337

regexec.c
t/op/re_tests

index 49a081f..6bddf2d 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3001,6 +3001,8 @@ S_regmatch(pTHX_ regnode *prog)
            else
                c1 = c2 = -1000;
            PL_reginput = locinput;
+           if (paren)
+               PL_regendp[paren] = -1;
            if (minmod) {
                CHECKPOINT lastcp;
                minmod = 0;
index 37e8ee3..263bded 100644 (file)
@@ -750,5 +750,6 @@ tt+$        xxxtt   y       -       -
 ^([a-z]:)      C:/     n       -       -
 '^\S\s+aa$'m   \nx aa  y       -       -
 (^|a)b ab      y       -       -
+^([ab]*?)(b)?(c)$      abac    y       -$2-    --
 (?i)           y       -       -
 '(?!\A)x'm     a\nxb\n y       -       -