summaryrefslogtreecommitdiff
path: root/testdata/testinput11
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-10-04 16:38:05 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-10-04 16:38:05 +0000
commit81c06c3725f4e173b64711b722b645efc206665d (patch)
treefa18759451292c297ce3a411a53773a843ad604a /testdata/testinput11
parentb77d63d3165d1678324a4bf4531fb881103f6012 (diff)
downloadpcre-81c06c3725f4e173b64711b722b645efc206665d.tar.gz
Make (*THEN) work as in Perl in subpatterns that do not contain | alternatives.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@716 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'testdata/testinput11')
-rw-r--r--testdata/testinput1198
1 files changed, 95 insertions, 3 deletions
diff --git a/testdata/testinput11 b/testdata/testinput11
index f71b56a..198dbf2 100644
--- a/testdata/testinput11
+++ b/testdata/testinput11
@@ -495,9 +495,6 @@ however, we need the complication for Perl. ---/
/(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
yes
-/^((yes|no)(*THEN)(*F))?/
- yes
-
/b?(*SKIP)c/
bc
abc
@@ -674,5 +671,100 @@ name)/K
a
ba
bba
+
+/--- Checking revised (*THEN) handling ---/
+
+/--- Capture ---/
+
+/^.*? (a(*THEN)b) c/x
+ aabc
+
+/^.*? (a(*THEN)b|(*F)) c/x
+ aabc
+
+/^.*? ( (a(*THEN)b) | (*F) ) c/x
+ aabc
+
+/^.*? ( (a(*THEN)b) ) c/x
+ aabc
+
+/--- Non-capture ---/
+
+/^.*? (?:a(*THEN)b) c/x
+ aabc
+
+/^.*? (?:a(*THEN)b|(*F)) c/x
+ aabc
+
+/^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
+ aabc
+
+/^.*? (?: (?:a(*THEN)b) ) c/x
+ aabc
+
+/--- Atomic ---/
+
+/^.*? (?>a(*THEN)b) c/x
+ aabc
+
+/^.*? (?>a(*THEN)b|(*F)) c/x
+ aabc
+
+/^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
+ aabc
+
+/^.*? (?> (?>a(*THEN)b) ) c/x
+ aabc
+
+/--- Possessive capture ---/
+
+/^.*? (a(*THEN)b)++ c/x
+ aabc
+
+/^.*? (a(*THEN)b|(*F))++ c/x
+ aabc
+
+/^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
+ aabc
+
+/^.*? ( (a(*THEN)b)++ )++ c/x
+ aabc
+
+/--- Possessive non-capture ---/
+
+/^.*? (?:a(*THEN)b)++ c/x
+ aabc
+
+/^.*? (?:a(*THEN)b|(*F))++ c/x
+ aabc
+
+/^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
+ aabc
+
+/^.*? (?: (?:a(*THEN)b)++ )++ c/x
+ aabc
+
+/--- Condition assertion ---/
+
+/^(?(?=a(*THEN)b)ab|ac)/
+ ac
+
+/--- Condition ---/
+
+/^.*?(?(?=a)a|b(*THEN)c)/
+ ba
+
+/^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
+ ba
+
+/^.*?(?(?=a)a(*THEN)b|c)/
+ ac
+
+/--- Assertion ---/
+
+/^.*(?=a(*THEN)b)/
+ aabc
+
+/------------------------------/
/-- End of testinput11 --/