diff options
-rw-r--r-- | regexec.c | 2 | ||||
-rw-r--r-- | t/op/re_tests | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -979,7 +979,7 @@ regmatch(regnode *prog) n = ARG(scan); /* which paren pair */ s = regstartp[n]; if (*reglastparen < n || !s) - break; /* Zero length always matches */ + sayNO; /* Do not match unless seen CLOSEn. */ if (s == regendp[n]) break; /* Inline the first character, for speed. */ diff --git a/t/op/re_tests b/t/op/re_tests index 121e96481f..9217fcca1f 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -322,9 +322,9 @@ a(?:b|(c|e){1,2}?|d)+?(.) ace y $1$2 ce ^(a\1?){4}$ aaaaaaaaaa y $1 aaaa ^(a\1?){4}$ aaaaaaaaa n - - ^(a\1?){4}$ aaaaaaaaaaa n - - -^(a\1){4}$ aaaaaaaaaa y $1 aaaa -^(a\1){4}$ aaaaaaaaa n - - -^(a\1){4}$ aaaaaaaaaaa n - - +^(a(?(1)\1)){4}$ aaaaaaaaaa y $1 aaaa +^(a(?(1)\1)){4}$ aaaaaaaaa n - - +^(a(?(1)\1)){4}$ aaaaaaaaaaa n - - (?:(f)(o)(o)|(b)(a)(r))* foobar y $1:$2:$3:$4:$5:$6 f:o:o:b:a:r (?<=a)b ab y $& b (?<=a)b cb n - - |