version 1.1, 2012/02/21 23:05:52
|
version 1.1.1.2, 2013/07/22 08:25:57
|
Line 1
|
Line 1
|
/-- These tests are for the Perl >= 5.10 features that PCRE supports. --/ | /-- These are a few representative patterns whose lengths and offsets are to be |
| shown when the link size is 2. This is just a doublecheck test to ensure the |
| sizes don't go horribly wrong when something is changed. The pattern contents |
| are all themselves checked in other tests. Unicode, including property support, |
| is required for these tests. --/ |
|
|
/\H\h\V\v/ | /((?i)b)/BM |
X X\x0a | |
X\x09X\x0b | |
** Failers | |
\xa0 X\x0a | |
| |
/\H*\h+\V?\v{3,4}/ | |
\x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a | |
\x09\x20\xa0\x0a\x0b\x0c\x0d\x0a | |
\x09\x20\xa0\x0a\x0b\x0c | |
** Failers | |
\x09\x20\xa0\x0a\x0b | |
| |
/\H{3,4}/ | |
XY ABCDE | |
XY PQR ST | |
| |
/.\h{3,4}./ | |
XY AB PQRS | |
|
|
/\h*X\h?\H+Y\H?Z/ | /(?s)(.*X|^B)/BM |
>XNNNYZ | |
> X NYQZ | |
** Failers | |
>XYZ | |
> X NY Z | |
|
|
/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ | /(?s:.*X|^B)/BM |
>XY\x0aZ\x0aA\x0bNN\x0c | |
>\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c | |
|
|
/(foo)\Kbar/ | /^[[:alnum:]]/BM |
foobar | |
| |
/(foo)(\Kbar|baz)/ | |
foobar | |
foobaz | |
|
|
/(foo\Kbar)baz/ | /#/IxMD |
foobarbaz | |
|
|
/abc\K|def\K/g+ | /a#/IxMD |
Xabcdefghi | |
|
|
/ab\Kc|de\Kf/g+ | /x?+/BM |
Xabcdefghi | |
| |
/(?=C)/g+ | |
ABCDECBA | |
| |
/^abc\K/+ | |
abcdef | |
** Failers | |
defabcxyz | |
|
|
/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ | /x++/BM |
ababababbbabZXXXX | |
|
|
/(?<A>tom|bon)-\g{A}/ | /x{1,3}+/BM |
tom-tom | |
bon-bon | |
| |
/(^(a|b\g{-1}))/ | |
bacxxx | |
|
|
/(?|(abc)|(xyz))\1/ | /(x)*+/BM |
abcabc | |
xyzxyz | |
** Failers | |
abcxyz | |
xyzabc | |
| |
/(?|(abc)|(xyz))(?1)/ | |
abcabc | |
xyzabc | |
** Failers | |
xyzxyz | |
| |
/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ | |
XYabcdY | |
|
|
/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ | /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/BM |
XYabcdY | |
|
|
/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ | |8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM |
XYabcdY | |
|
|
/(?'abc'\w+):\k<abc>{2}/ | |\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM |
a:aaxyz | |
ab:ababxyz | |
** Failers | |
a:axyz | |
ab:abxyz | |
|
|
/(?'abc'\w+):\g{abc}{2}/ | /(a(?1)b)/BM |
a:aaxyz | |
ab:ababxyz | |
** Failers | |
a:axyz | |
ab:abxyz | |
|
|
/^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x | /(a(?1)+b)/BM |
abd | |
ce | |
|
|
/^(a.)\g-1Z/ | /a(?P<name1>b|c)d(?P<longername2>e)/BM |
aXaXZ | |
|
|
/^(a.)\g{-1}Z/ | /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/BM |
aXaXZ | |
|
|
/^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x | /(?P<a>a)...(?P=a)bbb(?P>a)d/BM |
abcd | |
|
|
/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT)) | /abc(?C255)de(?C)f/BM |
(?(DEFINE) | |
(?<NAME_PAT>[a-z]+) | |
(?<ADDRESS_PAT>\d+) | |
)/x | |
metcalfe 33 | |
|
|
/(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/ | /abcde/CBM |
1.2.3.4 | |
131.111.10.206 | |
10.0.0.0 | |
** Failers | |
10.6 | |
455.3.4.5 | |
|
|
/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/ | /\x{100}/8BM |
1.2.3.4 | |
131.111.10.206 | |
10.0.0.0 | |
** Failers | |
10.6 | |
455.3.4.5 | |
|
|
/^(\w++|\s++)*$/ | /\x{1000}/8BM |
now is the time for all good men to come to the aid of the party | |
*** Failers | |
this is not a line with only words and spaces! | |
|
|
/(\d++)(\w)/ | /\x{10000}/8BM |
12345a | |
*** Failers | |
12345+ | |
|
|
/a++b/ | /\x{100000}/8BM |
aaab | |
|
|
/(a++b)/ | /\x{10ffff}/8BM |
aaab | |
|
|
/(a++)b/ | /\x{110000}/8BM |
aaab | |
|
|
/([^()]++|\([^()]*\))+/ | /[\x{ff}]/8BM |
((abc(ade)ufh()()x | |
|
|
/\(([^()]++|\([^()]+\))+\)/ | /[\x{100}]/8BM |
(abc) | |
(abc(def)xyz) | |
*** Failers | |
((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
|
|
/^([^()]|\((?1)*\))*$/ | /\x80/8BM |
abc | |
a(b)c | |
a(b(c))d | |
*** Failers) | |
a(b(c)d | |
|
|
/^>abc>([^()]|\((?1)*\))*<xyz<$/ | /\xff/8BM |
>abc>123<xyz< | |
>abc>1(2)3<xyz< | |
>abc>(1(2)3)<xyz< | |
|
|
/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i | /\x{0041}\x{2262}\x{0391}\x{002e}/D8M |
1221 | |
Satanoscillatemymetallicsonatas | |
AmanaplanacanalPanama | |
AblewasIereIsawElba | |
*** Failers | |
Thequickbrownfox | |
| |
/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ | |
12 | |
(((2+2)*-3)-7) | |
-12 | |
*** Failers | |
((2+2)*-3)-7) | |
| |
/^(x(y|(?1){2})z)/ | |
xyz | |
xxyzxyzz | |
*** Failers | |
xxyzz | |
xxyzxyzxyzz | |
| |
/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x | |
<> | |
<abcd> | |
<abc <123> hij> | |
<abc <def> hij> | |
<abc<>def> | |
<abc<> | |
*** Failers | |
<abc | |
| |
/^a+(*FAIL)/ | |
aaaaaa | |
|
|
/a+b?c+(*FAIL)/ | /\x{D55c}\x{ad6d}\x{C5B4}/D8M |
aaabccc | |
|
|
/a+b?(*PRUNE)c+(*FAIL)/ | /\x{65e5}\x{672c}\x{8a9e}/D8M |
aaabccc | |
|
|
/a+b?(*COMMIT)c+(*FAIL)/ | /[\x{100}]/8BM |
aaabccc | |
| |
/a+b?(*SKIP)c+(*FAIL)/ | |
aaabcccaaabccc | |
|
|
/^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ | /[Z\x{100}]/8BM |
aaaxxxxxx | |
aaa++++++ | |
bbbxxxxx | |
bbb+++++ | |
cccxxxx | |
ccc++++ | |
dddddddd | |
|
|
/^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ | /^[\x{100}\E-\Q\E\x{150}]/B8M |
aaaxxxxxx | |
aaa++++++ | |
bbbxxxxx | |
bbb+++++ | |
cccxxxx | |
ccc++++ | |
dddddddd | |
|
|
/a+b?(*THEN)c+(*FAIL)/ | /^[\QĀ\E-\QŐ\E]/B8M |
aaabccc | |
|
|
/(A (A|B(*ACCEPT)|C) D)(E)/x | /^[\QĀ\E-\QŐ\E/B8M |
AB | |
ABX | |
AADE | |
ACDE | |
** Failers | |
AD | |
| |
/^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i | |
1221 | |
Satan, oscillate my metallic sonatas! | |
A man, a plan, a canal: Panama! | |
Able was I ere I saw Elba. | |
*** Failers | |
The quick brown fox | |
|
|
/^((.)(?1)\2|.)$/ | /[\p{L}]/BM |
a | |
aba | |
aabaa | |
abcdcba | |
pqaabaaqp | |
ablewasiereisawelba | |
rhubarb | |
the quick brown fox | |
|
|
/(a)(?<=b(?1))/ | /[\p{^L}]/BM |
baz | |
** Failers | |
caz | |
| |
/(?<=b(?1))(a)/ | |
zbaaz | |
** Failers | |
aaa | |
| |
/(?<X>a)(?<=b(?&X))/ | |
baz | |
|
|
/^(?|(abc)|(def))\1/ | /[\P{L}]/BM |
abcabc | |
defdef | |
** Failers | |
abcdef | |
defabc | |
| |
/^(?|(abc)|(def))(?1)/ | |
abcabc | |
defabc | |
** Failers | |
defdef | |
abcdef | |
|
|
/(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/xJ | /[\P{^L}]/BM |
a\"aaaaa | |
b\"aaaaa | |
** Failers | |
b\"11111 | |
|
|
/(?:(?1)|B)(A(*F)|C)/ | /[abc\p{L}\x{0660}]/8BM |
ABCD | |
CCD | |
** Failers | |
CAD | |
|
|
/^(?:(?1)|B)(A(*F)|C)/ | /[\p{Nd}]/8BM |
CCD | |
BCD | |
** Failers | |
ABCD | |
CAD | |
BAD | |
|
|
/(?:(?1)|B)(A(*ACCEPT)XX|C)D/ | /[\p{Nd}+-]+/8BM |
AAD | |
ACD | |
BAD | |
BCD | |
BAX | |
** Failers | |
ACX | |
ABC | |
|
|
/(?(DEFINE)(A))B(?1)C/ | /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iBM |
BAC | |
|
|
/(?(DEFINE)((A)\2))B(?1)C/ | /A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8BM |
BAAC | |
|
|
/(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x | /[\x{105}-\x{109}]/8iBM |
(ab(cd)ef) | |
|
|
/^(?!a(*SKIP)b)/ | /( ( (?(1)0|) )* )/xBM |
ac | |
| |
/^(?=a(*SKIP)b|ac)/ | |
** Failers | |
ac | |
| |
/^(?=a(*THEN)b|ac)/ | |
ac | |
| |
/^(?=a(*PRUNE)b)/ | |
ab | |
** Failers | |
ac | |
|
|
/^(?=a(*ACCEPT)b)/ | /( (?(1)0|)* )/xBM |
ac | |
|
|
/^(?(?!a(*SKIP)b))/ | /[a]/BM |
ac | |
|
|
/(?>a\Kb)/ | /[a]/8BM |
ab | |
|
|
/((?>a\Kb))/ | /[\xaa]/BM |
ab | |
|
|
/(a\Kb)/ | /[\xaa]/8BM |
ab | |
| |
/^a\Kcz|ac/ | |
ac | |
| |
/(?>a\Kbz|ab)/ | |
ab | |
|
|
/^(?&t)(?(DEFINE)(?<t>a\Kb))$/ | /[^a]/BM |
ab | |
|
|
/^([^()]|\((?1)*\))*$/ | /[^a]/8BM |
a(b)c | |
a(b(c)d)e | |
|
|
/(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/ | /[^\xaa]/BM |
0 | |
00 | |
0000 | |
|
|
/(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/ | /[^\xaa]/8BM |
0 | |
00 | |
0000 | |
|
|
/--- This one does fail, as expected, in Perl. It needs the complex item at the | /[^\d]/8WB |
end of the pattern. A single letter instead of (B|D) makes it not fail, | |
which I think is a Perl bug. --- / | |
|
|
/A(*COMMIT)(B|D)/ | /[[:^alpha:][:^cntrl:]]+/8WB |
ACABX | |
|
|
/--- Check the use of names for failure ---/ | /[[:^cntrl:][:^alpha:]]+/8WB |
|
|
/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K | /[[:alpha:]]+/8WB |
** Failers | |
AC | |
CB | |
| |
/--- Force no study, otherwise mark is not seen. The studied version is in | |
test 2 because it isn't Perl-compatible. ---/ | |
|
|
/(*MARK:A)(*SKIP:B)(C|X)/KSS | /[[:^alpha:]\S]+/8WB |
C | |
D | |
| |
/^(A(*THEN:A)B|C(*THEN:B)D)/K | |
** Failers | |
CB | |
|
|
/^(?:A(*THEN:A)B|C(*THEN:B)D)/K | /abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/B |
CB | |
| |
/^(?>A(*THEN:A)B|C(*THEN:B)D)/K | |
CB | |
| |
/--- This should succeed, as the skip causes bump to offset 1 (the mark). Note | |
that we have to have something complicated such as (B|Z) at the end because, | |
for Perl, a simple character somehow causes an unwanted optimization to mess | |
with the handling of backtracking verbs. ---/ | |
| |
/A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK | |
AAAC | |
| |
/--- Test skipping over a non-matching mark. ---/ | |
| |
/A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK | |
AAAC | |
| |
/--- Check shorthand for MARK ---/ | |
| |
/A(*:A)A+(*SKIP:A)(B|Z) | AC/xK | |
AAAC | |
| |
/--- Don't loop! Force no study, otherwise mark is not seen. ---/ | |
| |
/(*:A)A+(*SKIP:A)(B|Z)/KSS | |
AAAC | |
| |
/--- This should succeed, as a non-existent skip name disables the skip ---/ | |
| |
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK | |
AAAC | |
| |
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK | |
AAAC | |
| |
/--- COMMIT at the start of a pattern should act like an anchor. Again, | |
however, we need the complication for Perl. ---/ | |
| |
/(*COMMIT)(A|P)(B|P)(C|P)/ | |
ABCDEFG | |
** Failers | |
DEFGABC | |
| |
/--- COMMIT inside an atomic group can't stop backtracking over the group. ---/ | |
| |
/(\w+)(?>b(*COMMIT))\w{2}/ | |
abbb | |
| |
/(\w+)b(*COMMIT)\w{2}/ | |
abbb | |
| |
/--- Check opening parens in comment when seeking forward reference. ---/ | |
| |
/(?&t)(?#()(?(DEFINE)(?<t>a))/ | |
bac | |
| |
/--- COMMIT should override THEN ---/ | |
| |
/(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/ | |
yes | |
| |
/(?>(*COMMIT)(yes|no)(*THEN)(*F))?/ | |
yes | |
| |
/b?(*SKIP)c/ | |
bc | |
abc | |
| |
/(*SKIP)bc/ | |
a | |
| |
/(*SKIP)b/ | |
a | |
| |
/(?P<abn>(?P=abn)xxx|)+/ | |
xxx | |
| |
/(?i:([^b]))(?1)/ | |
aa | |
aA | |
** Failers | |
ab | |
aB | |
Ba | |
ba | |
| |
/^(?&t)*+(?(DEFINE)(?<t>a))\w$/ | |
aaaaaaX | |
** Failers | |
aaaaaa | |
| |
/^(?&t)*(?(DEFINE)(?<t>a))\w$/ | |
aaaaaaX | |
aaaaaa | |
| |
/^(a)*+(\w)/ | |
aaaaX | |
YZ | |
** Failers | |
aaaa | |
| |
/^(?:a)*+(\w)/ | |
aaaaX | |
YZ | |
** Failers | |
aaaa | |
| |
/^(a)++(\w)/ | |
aaaaX | |
** Failers | |
aaaa | |
YZ | |
| |
/^(?:a)++(\w)/ | |
aaaaX | |
** Failers | |
aaaa | |
YZ | |
| |
/^(a)?+(\w)/ | |
aaaaX | |
YZ | |
| |
/^(?:a)?+(\w)/ | |
aaaaX | |
YZ | |
| |
/^(a){2,}+(\w)/ | |
aaaaX | |
** Failers | |
aaa | |
YZ | |
| |
/^(?:a){2,}+(\w)/ | |
aaaaX | |
** Failers | |
aaa | |
YZ | |
| |
/(a|)*(?1)b/ | |
b | |
ab | |
aab | |
| |
/(a)++(?1)b/ | |
** Failers | |
ab | |
aab | |
| |
/(a)*+(?1)b/ | |
** Failers | |
ab | |
aab | |
| |
/(?1)(?:(b)){0}/ | |
b | |
| |
/(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x | |
foo(bar(baz)+baz(bop)) | |
| |
/(A (A|B(*ACCEPT)|C) D)(E)/x | |
AB | |
| |
/\A.*?(?:a|b(*THEN)c)/ | |
ba | |
| |
/\A.*?(?:a|bc)/ | |
ba | |
| |
/\A.*?(a|b(*THEN)c)/ | |
ba | |
| |
/\A.*?(a|bc)/ | |
ba | |
| |
/\A.*?(?:a|b(*THEN)c)++/ | |
ba | |
| |
/\A.*?(?:a|bc)++/ | |
ba | |
| |
/\A.*?(a|b(*THEN)c)++/ | |
ba | |
| |
/\A.*?(a|bc)++/ | |
ba | |
| |
/\A.*?(?:a|b(*THEN)c|d)/ | |
ba | |
| |
/\A.*?(?:a|bc|d)/ | |
ba | |
| |
/(?:(b))++/ | |
beetle | |
| |
/(?(?=(a(*ACCEPT)z))a)/ | |
a | |
| |
/^(a)(?1)+ab/ | |
aaaab | |
| |
/^(a)(?1)++ab/ | |
aaaab | |
| |
/^(?=a(*:M))aZ/K | |
aZbc | |
| |
/^(?!(*:M)b)aZ/K | |
aZbc | |
| |
/(?(DEFINE)(a))?b(?1)/ | |
backgammon | |
| |
/^\N+/ | |
abc\ndef | |
| |
/^\N{1,}/ | |
abc\ndef | |
| |
/(?(R)a+|(?R)b)/ | |
aaaabcde | |
| |
/(?(R)a+|((?R))b)/ | |
aaaabcde | |
| |
/((?(R)a+|(?1)b))/ | |
aaaabcde | |
| |
/((?(R1)a+|(?1)b))/ | |
aaaabcde | |
| |
/a(*:any | |
name)/K | |
abc | |
| |
/(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/ | |
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 | |
| |
/------------------------------/ | |
| |
/(?>a(*:m))/imsxSK | |
a | |
| |
/(?>(a)(*:m))/imsxSK | |
a | |
| |
/(?<=a(*ACCEPT)b)c/ | |
xacd | |
| |
/(?<=(a(*ACCEPT)b))c/ | |
xacd | |
| |
/(?<=(a(*COMMIT)b))c/ | |
xabcd | |
** Failers | |
xacd | |
| |
/(?<!a(*FAIL)b)c/ | |
xcd | |
acd | |
| |
/(?<=a(*:N)b)c/K | |
xabcd | |
| |
/(?<=a(*PRUNE)b)c/ | |
xabcd | |
| |
/(?<=a(*SKIP)b)c/ | |
xabcd | |
| |
/(?<=a(*THEN)b)c/ | |
xabcd | |
| |
/(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 --/ |
/-- End of testinput11 --/ |