summaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-11-29 15:34:12 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-11-29 15:34:12 +0000
commit16679a7e31ef76cfc6d2026278768d800bf31fbe (patch)
treebab1731cf5dd006c566fe077a7195b482f7b3c9a /testdata
parent2790821e0a8cab583222865c95a311efa6d5757c (diff)
downloadpcre-16679a7e31ef76cfc6d2026278768d800bf31fbe.tar.gz
Update *MARK handling to be more like Perl.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@771 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'testdata')
-rw-r--r--testdata/testinput11150
-rw-r--r--testdata/testinput2206
-rw-r--r--testdata/testoutput11265
-rw-r--r--testdata/testoutput2343
4 files changed, 467 insertions, 497 deletions
diff --git a/testdata/testinput11 b/testdata/testinput11
index 661f193..0f33cb1 100644
--- a/testdata/testinput11
+++ b/testdata/testinput11
@@ -452,20 +452,6 @@ with the handling of backtracking verbs. ---/
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
AAAC
-/--- We use something more complicated than individual letters here, because
-that causes different behaviour in Perl. Perhaps it disables some optimization;
-anyway, the result now matches PCRE in that no tag is passed back for the
-failures. ---/
-
-/(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
- AABC
- XXYZ
- ** Failers
- XAQQ
- XAQQXZZ
- AXQQQ
- AXXQQQ
-
/--- COMMIT at the start of a pattern should act like an anchor. Again,
however, we need the complication for Perl. ---/
@@ -803,4 +789,140 @@ name)/K
/(a)(?2){2}(.)/
abcd
+/(*MARK:A)(*PRUNE:B)(C|X)/KS
+ C
+ D
+
+/(*MARK:A)(*PRUNE:B)(C|X)/KSS
+ C
+ D
+
+/(*MARK:A)(*THEN:B)(C|X)/KS
+ C
+ D
+
+/(*MARK:A)(*THEN:B)(C|X)/KSY
+ C
+ D
+
+/(*MARK:A)(*THEN:B)(C|X)/KSS
+ C
+ D
+
+/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
+
+/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
+ AAAC
+
+/--- Same --/
+
+/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
+ AAAC
+
+/A(*:A)A+(*SKIP)(B|Z) | AC/xK
+ AAAC
+
+/--- This should fail, as a null name is the same as no name ---/
+
+/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
+ AAAC
+
+/--- A check on what happens after hitting a mark and them bumping along to
+something that does not even start. Perl reports tags after the failures here,
+though it does not when the individual letters are made into something
+more complicated. ---/
+
+/A(*:A)B|XX(*:B)Y/K
+ AABC
+ XXYZ
+ ** Failers
+ XAQQ
+ XAQQXZZ
+ AXQQQ
+ AXXQQQ
+
+/^(A(*THEN:A)B|C(*THEN:B)D)/K
+ AB
+ CD
+ ** Failers
+ AC
+ CB
+
+/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
+ AB
+ CD
+ ** Failers
+ AC
+ CB
+
+/--- An empty name does not pass back an empty string. It is the same as if no
+name were given. ---/
+
+/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
+ AB
+ CD
+
+/--- PRUNE goes to next bumpalong; COMMIT does not. ---/
+
+/A(*PRUNE:A)B/K
+ ACAB
+
+/--- Mark names can be duplicated ---/
+
+/A(*:A)B|X(*:A)Y/K
+ AABC
+ XXYZ
+
+/b(*:m)f|a(*:n)w/K
+ aw
+ ** Failers
+ abc
+
+/b(*:m)f|aw/K
+ abaw
+ ** Failers
+ abc
+ abax
+
+/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
+ AAAC
+
+/a(*PRUNE:X)bc|qq/KY
+ ** Failers
+ axy
+
+/a(*THEN:X)bc|qq/KY
+ ** Failers
+ axy
+
+/(?=a(*MARK:A)b)..x/K
+ abxy
+ ** Failers
+ abpq
+
+/(?=a(*MARK:A)b)..(*:Y)x/K
+ abxy
+ ** Failers
+ abpq
+
+/(?=a(*PRUNE:A)b)..x/K
+ abxy
+ ** Failers
+ abpq
+
+/(?=a(*PRUNE:A)b)..(*:Y)x/K
+ abxy
+ ** Failers
+ abpq
+
+/(?=a(*THEN:A)b)..x/K
+ abxy
+ ** Failers
+ abpq
+
+/(?=a(*THEN:A)b)..(*:Y)x/K
+ abxy
+ ** Failers
+ abpq
+
/-- End of testinput11 --/
diff --git a/testdata/testinput2 b/testdata/testinput2
index c656cc0..19801ef 100644
--- a/testdata/testinput2
+++ b/testdata/testinput2
@@ -3325,116 +3325,19 @@ a random value. /Ix
/A(*PRUNE)B|A(*PRUNE)C/K
AC
-/--- A whole lot of tests of verbs with arguments are here rather than in test
- 11 because Perl doesn't seem to follow its specification entirely
- correctly. ---/
-
-/--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
- not clear how Perl defines "involved in the failure of the match". ---/
-
-/^(A(*THEN:A)B|C(*THEN:B)D)/K
- AB
- CD
- ** Failers
- AC
- CB
-
-/--- Check the use of names for success and failure. PCRE doesn't show these
-names for success, though Perl does, contrary to its spec. ---/
-
-/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
- AB
- CD
- ** Failers
- AC
- CB
-
-/--- An empty name does not pass back an empty string. It is the same as if no
-name were given. ---/
-
-/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
- AB
- CD
-
-/--- PRUNE goes to next bumpalong; COMMIT does not. ---/
-
-/A(*PRUNE:A)B/K
- ACAB
-
-/(*MARK:A)(*PRUNE:B)(C|X)/KS
- C
- D
-
-/(*MARK:A)(*PRUNE:B)(C|X)/KSS
- C
- D
-
-/(*MARK:A)(*THEN:B)(C|X)/KS
- C
- D
-
-/(*MARK:A)(*THEN:B)(C|X)/KSY
- C
- D
-
-/(*MARK:A)(*THEN:B)(C|X)/KSS
- C
- D
-
-/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
-
-/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
- AAAC
-
-/--- Same --/
-
-/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
- AAAC
-
/--- This should fail; the SKIP advances by one, but when we get to AC, the
- PRUNE kills it. ---/
+ PRUNE kills it. Perl behaves differently. ---/
/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
AAAC
-/A(*:A)A+(*SKIP)(B|Z) | AC/xK
- AAAC
-
-/--- This should fail, as a null name is the same as no name ---/
+/--- Mark names can be duplicated. Perl doesn't give a mark for this one,
+though PCRE does. ---/
-/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
- AAAC
-
-/--- This fails in PCRE, and I think that is in accordance with Perl's
- documentation, though in Perl it succeeds. ---/
-
-/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
- AAAC
-
-/--- Mark names can be duplicated ---/
-
-/A(*:A)B|X(*:A)Y/K
- AABC
- XXYZ
-
/^A(*:A)B|^X(*:A)Y/K
** Failers
XAQQ
-/--- A check on what happens after hitting a mark and them bumping along to
-something that does not even start. Perl reports tags after the failures here,
-though it does not when the individual letters are made into something
-more complicated. ---/
-
-/A(*:A)B|XX(*:B)Y/K
- AABC
- XXYZ
- ** Failers
- XAQQ
- XAQQXZZ
- AXQQQ
- AXXQQQ
-
/--- COMMIT at the start of a pattern should be the same as an anchor. Perl
optimizations defeat this. So does the PCRE optimization unless we disable it
with \Y. ---/
@@ -3444,78 +3347,6 @@ with \Y. ---/
** Failers
DEFGABC\Y
-/--- Repeat some tests with added studying. ---/
-
-/A(*COMMIT)B/+KS
- ACABX
-
-/A(*THEN)B|A(*THEN)C/KS
- AC
-
-/A(*PRUNE)B|A(*PRUNE)C/KS
- AC
-
-/^(A(*THEN:A)B|C(*THEN:B)D)/KS
- AB
- CD
- ** Failers
- AC
- CB
-
-/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
- AB
- CD
- ** Failers
- AC
- CB
-
-/^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
- AB
- CD
-
-/A(*PRUNE:A)B/KS
- ACAB
-
-/(*MARK:A)(*PRUNE:B)(C|X)/KS
- C
- D
-
-/(*MARK:A)(*THEN:B)(C|X)/KS
- C
- D
-
-/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
- AAAC
-
-/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
- AAAC
-
-/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
- AAAC
-
-/A(*:A)A+(*SKIP)(B|Z) | AC/xKS
- AAAC
-
-/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
- AAAC
-
-/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
- AAAC
-
-/A(*:A)B|XX(*:B)Y/KS
- AABC
- XXYZ
- ** Failers
- XAQQ
- XAQQXZZ
- AXQQQ
- AXXQQQ
-
-/(*COMMIT)ABC/
- ABCDEFG
- ** Failers
- DEFGABC\Y
-
/^(ab (c+(*THEN)cd) | xyz)/x
abcccd
@@ -4014,4 +3845,35 @@ AbcdCBefgBhiBqz
/(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
+/--- This test, with something more complicated than individual letters, causes
+different behaviour in Perl. Perhaps it disables some optimization; no tag is
+passed back for the failures, whereas in PCRE there is a tag. ---/
+
+/(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
+ AABC
+ XXYZ
+ ** Failers
+ XAQQ
+ XAQQXZZ
+ AXQQQ
+ AXXQQQ
+
+/-- Perl doesn't give marks for these, though it does if the alternatives are
+replaced by single letters. --/
+
+/(b|q)(*:m)f|a(*:n)w/K
+ aw
+ ** Failers
+ abc
+
+/(q|b)(*:m)f|a(*:n)w/K
+ aw
+ ** Failers
+ abc
+
+/-- After a partial match, the behaviour is as for a failure. --/
+
+/^a(*:X)bcde/K
+ abc\P
+
/-- End of testinput2 --/
diff --git a/testdata/testoutput11 b/testdata/testoutput11
index 8bd5da1..fd4ae01 100644
--- a/testdata/testoutput11
+++ b/testdata/testoutput11
@@ -888,36 +888,6 @@ No match, mark = A
0: AC
MK: B
-/--- We use something more complicated than individual letters here, because
-that causes different behaviour in Perl. Perhaps it disables some optimization;
-anyway, the result now matches PCRE in that no tag is passed back for the
-failures. ---/
-
-/(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
- AABC
- 0: AB
- 1: A
- 2: B
-MK: A
- XXYZ
- 0: XXY
- 1: <unset>
- 2: <unset>
- 3: X
- 4: X
- 5: Y
-MK: B
- ** Failers
-No match
- XAQQ
-No match
- XAQQXZZ
-No match
- AXQQQ
-No match
- AXXQQQ
-No match
-
/--- COMMIT at the start of a pattern should act like an anchor. Again,
however, we need the complication for Perl. ---/
@@ -1447,4 +1417,239 @@ MK: N
1: a
2: d
+/(*MARK:A)(*PRUNE:B)(C|X)/KS
+ C
+ 0: C
+ 1: C
+MK: B
+ D
+No match, mark = B
+
+/(*MARK:A)(*PRUNE:B)(C|X)/KSS
+ C
+ 0: C
+ 1: C
+MK: B
+ D
+No match, mark = B
+
+/(*MARK:A)(*THEN:B)(C|X)/KS
+ C
+ 0: C
+ 1: C
+MK: B
+ D
+No match, mark = B
+
+/(*MARK:A)(*THEN:B)(C|X)/KSY
+ C
+ 0: C
+ 1: C
+MK: B
+ D
+No match, mark = B
+
+/(*MARK:A)(*THEN:B)(C|X)/KSS
+ C
+ 0: C
+ 1: C
+MK: B
+ D
+No match, mark = B
+
+/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
+
+/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
+ AAAC
+No match, mark = A
+
+/--- Same --/
+
+/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
+ AAAC
+No match, mark = B
+
+/A(*:A)A+(*SKIP)(B|Z) | AC/xK
+ AAAC
+No match, mark = A
+
+/--- This should fail, as a null name is the same as no name ---/
+
+/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
+ AAAC
+No match, mark = A
+
+/--- A check on what happens after hitting a mark and them bumping along to
+something that does not even start. Perl reports tags after the failures here,
+though it does not when the individual letters are made into something
+more complicated. ---/
+
+/A(*:A)B|XX(*:B)Y/K
+ AABC
+ 0: AB
+MK: A
+ XXYZ
+ 0: XXY
+MK: B
+ ** Failers
+No match
+ XAQQ
+No match, mark = A
+ XAQQXZZ
+No match, mark = A
+ AXQQQ
+No match, mark = A
+ AXXQQQ
+No match, mark = B
+
+/^(A(*THEN:A)B|C(*THEN:B)D)/K
+ AB
+ 0: AB
+ 1: AB
+MK: A
+ CD
+ 0: CD
+ 1: CD
+MK: B
+ ** Failers
+No match
+ AC
+No match, mark = A
+ CB
+No match, mark = B
+
+/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
+ AB
+ 0: AB
+ 1: AB
+MK: A
+ CD
+ 0: CD
+ 1: CD
+MK: B
+ ** Failers
+No match
+ AC
+No match, mark = A
+ CB
+No match, mark = B
+
+/--- An empty name does not pass back an empty string. It is the same as if no
+name were given. ---/
+
+/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
+ AB
+ 0: AB
+ 1: AB
+ CD
+ 0: CD
+ 1: CD
+MK: B
+
+/--- PRUNE goes to next bumpalong; COMMIT does not. ---/
+
+/A(*PRUNE:A)B/K
+ ACAB
+ 0: AB
+MK: A
+
+/--- Mark names can be duplicated ---/
+
+/A(*:A)B|X(*:A)Y/K
+ AABC
+ 0: AB
+MK: A
+ XXYZ
+ 0: XY
+MK: A
+
+/b(*:m)f|a(*:n)w/K
+ aw
+ 0: aw
+MK: n
+ ** Failers
+No match, mark = n
+ abc
+No match, mark = m
+
+/b(*:m)f|aw/K
+ abaw
+ 0: aw
+ ** Failers
+No match
+ abc
+No match, mark = m
+ abax
+No match, mark = m
+
+/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
+ AAAC
+ 0: AAC
+
+/a(*PRUNE:X)bc|qq/KY
+ ** Failers
+No match, mark = X
+ axy
+No match, mark = X
+
+/a(*THEN:X)bc|qq/KY
+ ** Failers
+No match, mark = X
+ axy
+No match, mark = X
+
+/(?=a(*MARK:A)b)..x/K
+ abxy
+ 0: abx
+MK: A
+ ** Failers
+No match
+ abpq
+No match
+
+/(?=a(*MARK:A)b)..(*:Y)x/K
+ abxy
+ 0: abx
+MK: Y
+ ** Failers
+No match
+ abpq
+No match
+
+/(?=a(*PRUNE:A)b)..x/K
+ abxy
+ 0: abx
+MK: A
+ ** Failers
+No match
+ abpq
+No match
+
+/(?=a(*PRUNE:A)b)..(*:Y)x/K
+ abxy
+ 0: abx
+MK: Y
+ ** Failers
+No match
+ abpq
+No match
+
+/(?=a(*THEN:A)b)..x/K
+ abxy
+ 0: abx
+MK: A
+ ** Failers
+No match
+ abpq
+No match
+
+/(?=a(*THEN:A)b)..(*:Y)x/K
+ abxy
+ 0: abx
+MK: Y
+ ** Failers
+No match
+ abpq
+No match
+
/-- End of testinput11 --/
diff --git a/testdata/testoutput2 b/testdata/testoutput2
index 97b9f29..30a6e8f 100644
--- a/testdata/testoutput2
+++ b/testdata/testoutput2
@@ -10992,176 +10992,22 @@ No match
AC
No match
-/--- A whole lot of tests of verbs with arguments are here rather than in test
- 11 because Perl doesn't seem to follow its specification entirely
- correctly. ---/
-
-/--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
- not clear how Perl defines "involved in the failure of the match". ---/
-
-/^(A(*THEN:A)B|C(*THEN:B)D)/K
- AB
- 0: AB
- 1: AB
- CD
- 0: CD
- 1: CD
- ** Failers
-No match
- AC
-No match
- CB
-No match, mark = B
-
-/--- Check the use of names for success and failure. PCRE doesn't show these
-names for success, though Perl does, contrary to its spec. ---/
-
-/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
- AB
- 0: AB
- 1: AB
- CD
- 0: CD
- 1: CD
- ** Failers
-No match
- AC
-No match, mark = A
- CB
-No match, mark = B
-
-/--- An empty name does not pass back an empty string. It is the same as if no
-name were given. ---/
-
-/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
- AB
- 0: AB
- 1: AB
- CD
- 0: CD
- 1: CD
-
-/--- PRUNE goes to next bumpalong; COMMIT does not. ---/
-
-/A(*PRUNE:A)B/K
- ACAB
- 0: AB
-
-/(*MARK:A)(*PRUNE:B)(C|X)/KS
- C
- 0: C
- 1: C
-MK: A
- D
-No match
-
-/(*MARK:A)(*PRUNE:B)(C|X)/KSS
- C
- 0: C
- 1: C
-MK: A
- D
-No match, mark = B
-
-/(*MARK:A)(*THEN:B)(C|X)/KS
- C
- 0: C
- 1: C
-MK: A
- D
-No match
-
-/(*MARK:A)(*THEN:B)(C|X)/KSY
- C
- 0: C
- 1: C
-MK: A
- D
-No match, mark = B
-
-/(*MARK:A)(*THEN:B)(C|X)/KSS
- C
- 0: C
- 1: C
-MK: A
- D
-No match, mark = B
-
-/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
-
-/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
- AAAC
-No match
-
-/--- Same --/
-
-/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
- AAAC
-No match
-
/--- This should fail; the SKIP advances by one, but when we get to AC, the
- PRUNE kills it. ---/
+ PRUNE kills it. Perl behaves differently. ---/
/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
AAAC
-No match
-
-/A(*:A)A+(*SKIP)(B|Z) | AC/xK
- AAAC
-No match
-
-/--- This should fail, as a null name is the same as no name ---/
-
-/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
- AAAC
-No match
-
-/--- This fails in PCRE, and I think that is in accordance with Perl's
- documentation, though in Perl it succeeds. ---/
-
-/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
- AAAC
-No match
+No match, mark = A
-/--- Mark names can be duplicated ---/
+/--- Mark names can be duplicated. Perl doesn't give a mark for this one,
+though PCRE does. ---/
-/A(*:A)B|X(*:A)Y/K
- AABC
- 0: AB
-MK: A
- XXYZ
- 0: XY
-MK: A
-
/^A(*:A)B|^X(*:A)Y/K
** Failers
No match
XAQQ
No match, mark = A
-/--- A check on what happens after hitting a mark and them bumping along to
-something that does not even start. Perl reports tags after the failures here,
-though it does not when the individual letters are made into something
-more complicated. ---/
-
-/A(*:A)B|XX(*:B)Y/K
- AABC
- 0: AB
-MK: A
- XXYZ
- 0: XXY
-MK: B
- ** Failers
-No match
- XAQQ
-No match
- XAQQXZZ
-No match
- AXQQQ
-No match
- AXXQQQ
-No match
-
/--- COMMIT at the start of a pattern should be the same as an anchor. Perl
optimizations defeat this. So does the PCRE optimization unless we disable it
with \Y. ---/
@@ -11174,126 +11020,6 @@ No match
DEFGABC\Y
No match
-/--- Repeat some tests with added studying. ---/
-
-/A(*COMMIT)B/+KS
- ACABX
-No match
-
-/A(*THEN)B|A(*THEN)C/KS
- AC
- 0: AC
-
-/A(*PRUNE)B|A(*PRUNE)C/KS
- AC
-No match
-
-/^(A(*THEN:A)B|C(*THEN:B)D)/KS
- AB
- 0: AB
- 1: AB
- CD
- 0: CD
- 1: CD
- ** Failers
-No match
- AC
-No match
- CB
-No match, mark = B
-
-/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
- AB
- 0: AB
- 1: AB
- CD
- 0: CD
- 1: CD
- ** Failers
-No match
- AC
-No match, mark = A
- CB
-No match, mark = B
-
-/^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
- AB
- 0: AB
- 1: AB
- CD
- 0: CD
- 1: CD
-
-/A(*PRUNE:A)B/KS
- ACAB
- 0: AB
-
-/(*MARK:A)(*PRUNE:B)(C|X)/KS
- C
- 0: C
- 1: C
-MK: A
- D
-No match
-
-/(*MARK:A)(*THEN:B)(C|X)/KS
- C
- 0: C
- 1: C
-MK: A
- D
-No match
-
-/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
- AAAC
-No match
-
-/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
- AAAC
-No match
-
-/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
- AAAC
-No match
-
-/A(*:A)A+(*SKIP)(B|Z) | AC/xKS
- AAAC
-No match
-
-/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
- AAAC
-No match
-
-/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
- AAAC
-No match
-
-/A(*:A)B|XX(*:B)Y/KS
- AABC
- 0: AB
-MK: A
- XXYZ
- 0: XXY
-MK: B
- ** Failers
-No match
- XAQQ
-No match
- XAQQXZZ
-No match
- AXQQQ
-No match
- AXXQQQ
-No match
-
-/(*COMMIT)ABC/
- ABCDEFG
- 0: ABC
- ** Failers
-No match
- DEFGABC\Y
-No match
-
/^(ab (c+(*THEN)cd) | xyz)/x
abcccd
No match
@@ -11878,11 +11604,11 @@ No match
1: C
MK: A
D
-No match
+No match, mark = A
/(*:A)A+(*SKIP:A)(B|Z)/KS
AAAC
-No match
+No match, mark = A
/-- --/
@@ -12260,7 +11986,6 @@ Latest Mark: A
Latest Mark: B
+18 ^ ^ z
+20 ^ a
-Latest Mark: <unset>
+21 ^^ e
+22 ^ ^ q
+23 ^ ^ )
@@ -12597,4 +12322,60 @@ Failed: too many forward references at offset 15
/(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
+/--- This test, with something more complicated than individual letters, causes
+different behaviour in Perl. Perhaps it disables some optimization; no tag is
+passed back for the failures, whereas in PCRE there is a tag. ---/
+
+/(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
+ AABC
+ 0: AB
+ 1: A
+ 2: B
+MK: A
+ XXYZ
+ 0: XXY
+ 1: <unset>
+ 2: <unset>
+ 3: X
+ 4: X
+ 5: Y
+MK: B
+ ** Failers
+No match
+ XAQQ
+No match, mark = A
+ XAQQXZZ
+No match, mark = A
+ AXQQQ
+No match, mark = A
+ AXXQQQ
+No match, mark = B
+
+/-- Perl doesn't give marks for these, though it does if the alternatives are
+replaced by single letters. --/
+
+/(b|q)(*:m)f|a(*:n)w/K
+ aw
+ 0: aw
+MK: n
+ ** Failers
+No match, mark = n
+ abc
+No match, mark = m
+
+/(q|b)(*:m)f|a(*:n)w/K
+ aw
+ 0: aw
+MK: n
+ ** Failers
+No match, mark = n
+ abc
+No match, mark = m
+
+/-- After a partial match, the behaviour is as for a failure. --/
+
+/^a(*:X)bcde/K
+ abc\P
+Partial match, mark=X: abc
+
/-- End of testinput2 --/