summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regexec.c2
-rw-r--r--t/op/re_tests6
2 files changed, 4 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 5fe5e4b9a9..b11bb9af86 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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 - -