php-src/ext/pcre/pcrelib/testdata/testinput2

3574 lines
65 KiB
Plaintext
Raw Normal View History

2009-11-03 12:15:03 +00:00
/-- This set of tests is not Perl-compatible. It checks on special features
of PCRE's API, error diagnostics, and the compiled code of some patterns.
It also checks the non-Perl syntax the PCRE supports (Python, .NET,
Oniguruma). Finally, there are some tests where PCRE and Perl differ,
2010-07-02 17:17:16 +00:00
either because PCRE can't be compatible, or there is a possible Perl
2009-11-03 12:15:03 +00:00
bug. --/
2011-05-13 07:00:45 +00:00
/-- Originally, the Perl >= 5.10 things were in here too, but now I have
2010-07-02 17:17:16 +00:00
separated many (most?) of them out into test 11. However, there may still
be some that were overlooked. --/
2009-11-03 12:15:03 +00:00
2007-02-09 20:13:18 +00:00
/(a)b|/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/abc/I
2000-04-11 17:36:06 +00:00
abc
defabc
\Aabc
*** Failers
\Adefabc
ABC
2007-02-09 20:13:18 +00:00
/^abc/I
2000-04-11 17:36:06 +00:00
abc
\Aabc
*** Failers
defabc
\Adefabc
2007-02-09 20:13:18 +00:00
/a+bc/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a*bc/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a{3}bc/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(abc|a+z)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/^abc$/I
2000-04-11 17:36:06 +00:00
abc
*** Failers
def\nabc
/ab\idef/X
2000-04-11 17:36:06 +00:00
/(?X)ab\idef/X
2000-04-11 17:36:06 +00:00
/x{5,4}/
/z{65536}/
/[abcd/
/(?X)[\B]/
2000-04-11 17:36:06 +00:00
2010-07-02 17:17:16 +00:00
/(?X)[\R]/
/(?X)[\X]/
/[\B]/BZ
/[\R]/BZ
/[\X]/BZ
2000-04-11 17:36:06 +00:00
/[z-a]/
/^*/
/(abc/
/(?# abc/
/(?z)abc/
2007-02-09 20:13:18 +00:00
/.*b/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/.*?b/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/cat|dog|elephant/I
2000-04-11 17:36:06 +00:00
this sentence eventually mentions a cat
this sentences rambles on and on for a while and then reaches elephant
2007-02-09 20:13:18 +00:00
/cat|dog|elephant/IS
2000-04-11 17:36:06 +00:00
this sentence eventually mentions a cat
this sentences rambles on and on for a while and then reaches elephant
2007-02-09 20:13:18 +00:00
/cat|dog|elephant/IiS
2000-04-11 17:36:06 +00:00
this sentence eventually mentions a CAT cat
this sentences rambles on and on for a while to elephant ElePhant
2007-02-09 20:13:18 +00:00
/a|[bcd]/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(a|[^\dZ])/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(a|b)*[\s]/IS
2000-04-11 17:36:06 +00:00
/(ab\2)/
/{4,5}abc/
2007-02-09 20:13:18 +00:00
/(a)(b)(c)\2/I
2000-04-11 17:36:06 +00:00
abcb
\O0abcb
\O3abcb
\O6abcb
\O9abcb
\O12abcb
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(a)bc|(a)(b)\2/I
2000-04-11 17:36:06 +00:00
abc
\O0abc
\O3abc
\O6abc
aba
\O0aba
\O3aba
\O6aba
\O9aba
\O12aba
2007-02-09 20:13:18 +00:00
/abc$/IE
2000-04-11 17:36:06 +00:00
abc
*** Failers
abc\n
abc\ndef
/(a)(b)(c)(d)(e)\6/
2007-02-09 20:13:18 +00:00
/the quick brown fox/I
2000-04-11 17:36:06 +00:00
the quick brown fox
this is a line with the quick brown fox
2007-02-09 20:13:18 +00:00
/the quick brown fox/IA
2000-04-11 17:36:06 +00:00
the quick brown fox
*** Failers
this is a line with the quick brown fox
/ab(?z)cd/
2007-02-09 20:13:18 +00:00
/^abc|def/I
2000-04-11 17:36:06 +00:00
abcdef
abcdef\B
2007-02-09 20:13:18 +00:00
/.*((abc)$|(def))/I
2000-04-11 17:36:06 +00:00
defabc
\Zdefabc
2009-11-03 12:15:03 +00:00
/abc/P
2000-04-11 17:36:06 +00:00
abc
*** Failers
2009-11-03 12:15:03 +00:00
/^abc|def/P
2000-04-11 17:36:06 +00:00
abcdef
abcdef\B
2009-11-03 12:15:03 +00:00
/.*((abc)$|(def))/P
2000-04-11 17:36:06 +00:00
defabc
\Zdefabc
2009-11-03 12:15:03 +00:00
/the quick brown fox/P
2000-04-11 17:36:06 +00:00
the quick brown fox
*** Failers
The Quick Brown Fox
2000-04-11 17:36:06 +00:00
2009-11-03 12:15:03 +00:00
/the quick brown fox/Pi
2000-04-11 17:36:06 +00:00
the quick brown fox
The Quick Brown Fox
2000-04-11 17:36:06 +00:00
2009-11-03 12:15:03 +00:00
/abc.def/P
2000-04-11 17:36:06 +00:00
*** Failers
abc\ndef
2009-11-03 12:15:03 +00:00
/abc$/P
2000-04-11 17:36:06 +00:00
abc
abc\n
2000-04-11 17:36:06 +00:00
2009-11-03 12:15:03 +00:00
/(abc)\2/P
2000-04-11 17:36:06 +00:00
2009-11-03 12:15:03 +00:00
/(abc\1)/P
2000-04-11 17:36:06 +00:00
abc
/)/
/a[]b/
2007-02-09 20:13:18 +00:00
/[^aeiou ]{3,}/I
co-processors, and for
2007-02-09 20:13:18 +00:00
/<.*>/I
2000-04-11 17:36:06 +00:00
abc<def>ghi<klm>nop
2007-02-09 20:13:18 +00:00
/<.*?>/I
2000-04-11 17:36:06 +00:00
abc<def>ghi<klm>nop
2007-02-09 20:13:18 +00:00
/<.*>/IU
2000-04-11 17:36:06 +00:00
abc<def>ghi<klm>nop
2007-02-09 20:13:18 +00:00
/(?U)<.*>/I
2000-04-11 17:36:06 +00:00
abc<def>ghi<klm>nop
2007-02-09 20:13:18 +00:00
/<.*?>/IU
2000-04-11 17:36:06 +00:00
abc<def>ghi<klm>nop
2007-02-09 20:13:18 +00:00
/={3,}/IU
2000-04-11 17:36:06 +00:00
abc========def
2007-02-09 20:13:18 +00:00
/(?U)={3,}?/I
2000-04-11 17:36:06 +00:00
abc========def
2007-02-09 20:13:18 +00:00
/(?<!bar|cattle)foo/I
2000-04-11 17:36:06 +00:00
foo
catfoo
2000-04-11 17:36:06 +00:00
*** Failers
the barfoo
and cattlefoo
2000-04-11 17:36:06 +00:00
/(?<=a+)b/
/(?<=aaa|b{0,3})b/
/(?<!(foo)a\1)bar/
2007-02-09 20:13:18 +00:00
/(?i)abc/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(a|(?m)a)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?i)^1234/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(^b|(?i)^d)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?s).*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/[abcd]/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?i)[abcd]/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?m)[xy]|(b|c)/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(^a|^b)/Im
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?i)(^a|^b)/Im
2000-04-11 17:36:06 +00:00
/(a)(?(1)a|b|c)/
/(?(?=a)a|b|c)/
/(?(1a)/
2007-02-09 20:13:18 +00:00
/(?(1a))/
2000-04-11 17:36:06 +00:00
/(?(?i))/
/(?(abc))/
/(?(?<ab))/
2007-02-09 20:13:18 +00:00
/((?s)blah)\s+\1/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/((?i)blah)\s+\1/I
2000-04-11 17:36:06 +00:00
/((?i)b)/IDZS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(a*b|(?i:c*(?-i)d))/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a$/I
2000-04-11 17:36:06 +00:00
a
a\n
*** Failers
2000-04-11 17:36:06 +00:00
\Za
\Za\n
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a$/Im
2000-04-11 17:36:06 +00:00
a
a\n
\Za\n
*** Failers
2000-04-11 17:36:06 +00:00
\Za
2007-02-09 20:13:18 +00:00
/\Aabc/Im
2000-04-11 17:36:06 +00:00
/^abc/Im
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
2000-04-11 17:36:06 +00:00
aaaaabbbbbcccccdef
2007-02-09 20:13:18 +00:00
/(?<=foo)[ab]/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?<!foo)(alpha|omega)/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?!alphabet)[ab]/IS
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?<=foo\n)^bar/Im
foo\nbarbar
***Failers
rhubarb
barbell
abc\nbarton
2007-02-09 20:13:18 +00:00
/^(?<=foo\n)bar/Im
foo\nbarbar
***Failers
rhubarb
barbell
abc\nbarton
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?>^abc)/Im
2000-04-11 17:36:06 +00:00
abc
def\nabc
*** Failers
defabc
2000-04-11 17:36:06 +00:00
/(?<=ab(c+)d)ef/
/(?<=ab(?<=c+)d)ef/
/(?<=ab(c|de)f)g/
/The next three are in testinput2 because they have variable length branches/
2007-02-09 20:13:18 +00:00
/(?<=bullock|donkey)-cart/I
2000-04-11 17:36:06 +00:00
the bullock-cart
a donkey-cart race
*** Failers
cart
horse-and-cart
2007-02-09 20:13:18 +00:00
/(?<=ab(?i)x|y|z)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?>.*)(?<=(abcd)|(xyz))/I
2000-04-11 17:36:06 +00:00
alphabetabcd
endingxyz
2007-02-09 20:13:18 +00:00
/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
2000-04-11 17:36:06 +00:00
abxyZZ
abXyZZ
ZZZ
zZZ
bZZ
BZZ
2000-04-11 17:36:06 +00:00
*** Failers
ZZ
abXYZZ
2000-04-11 17:36:06 +00:00
zzz
bzz
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?<!(foo)a)bar/I
2000-04-11 17:36:06 +00:00
bar
foobbar
2000-04-11 17:36:06 +00:00
*** Failers
fooabar
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/This one is here because Perl 5.005_02 doesn't fail it/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/^(a)?(?(1)a|b)+$/I
2000-04-11 17:36:06 +00:00
*** Failers
a
2000-04-11 17:36:06 +00:00
2010-01-21 17:49:38 +00:00
/This one is here because Perl behaves differently; see also the following/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/^(a\1?){4}$/I
2010-01-21 17:49:38 +00:00
aaaa
2000-04-11 17:36:06 +00:00
aaaaaa
2010-01-21 17:49:38 +00:00
/Perl does not fail these two for the final subjects. Neither did PCRE until/
/release 8.01. The problem is in backtracking into a subpattern that contains/
/a recursive reference to itself. PCRE has now made these into atomic patterns./
/^(xa|=?\1a){2}$/
xa=xaa
** Failers
xa=xaaa
/^(xa|=?\1a)+$/
xa=xaa
** Failers
xa=xaaa
2007-02-09 20:13:18 +00:00
/These are syntax tests from Perl 5.005/I
2000-04-11 17:36:06 +00:00
/a[b-a]/
/a[]b/
/a[/
/*a/
/(*)b/
/abc)/
/(abc/
/a**/
/)(/
/\1/
/\2/
/(a)|\2/
2007-02-09 20:13:18 +00:00
/a[b-a]/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a[]b/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a[/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/*a/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(*)b/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/abc)/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(abc/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a**/Ii
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/)(/Ii
2000-04-11 17:36:06 +00:00
/:(?:/
/(?<%)b/
/a(?{)b/
/a(?{{})b/
/a(?{}})b/
/a(?{"{"})b/
/a(?{"{"}})b/
/(?(1?)a|b)/
/[a[:xyz:/
/(?<=x+)y/
/a{37,17}/
/abc/\
/abc/\P
/abc/\i
2007-02-09 20:13:18 +00:00
/(a)bc(d)/I
2000-04-11 17:36:06 +00:00
abcd
abcd\C2
abcd\C5
2007-02-09 20:13:18 +00:00
/(.{20})/I
2000-04-11 17:36:06 +00:00
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz\C1
abcdefghijklmnopqrstuvwxyz\G1
2007-02-09 20:13:18 +00:00
/(.{15})/I
2000-04-11 17:36:06 +00:00
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz\C1\G1
2007-02-09 20:13:18 +00:00
/(.{16})/I
2000-04-11 17:36:06 +00:00
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz\C1\G1\L
2007-02-09 20:13:18 +00:00
/^(a|(bc))de(f)/I
adef\G1\G2\G3\G4\L
bcdef\G1\G2\G3\G4\L
adefghijk\C0
2007-02-09 20:13:18 +00:00
/^abc\00def/I
abc\00def\L\C0
2000-04-11 17:36:06 +00:00
/word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
)((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
)?)?)?)?)?)?)?)?)?otherword/I
2000-04-11 17:36:06 +00:00
/.*X/IDZ
2000-04-11 17:36:06 +00:00
/.*X/IDZs
2000-04-11 17:36:06 +00:00
/(.*X|^B)/IDZ
2000-04-11 17:36:06 +00:00
/(.*X|^B)/IDZs
/(?s)(.*X|^B)/IDZ
/(?s:.*X|^B)/IDZ
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/\Biss\B/I+
2000-04-11 17:36:06 +00:00
Mississippi
2007-02-09 20:13:18 +00:00
/\Biss\B/I+P
2000-04-11 17:36:06 +00:00
Mississippi
2007-02-09 20:13:18 +00:00
/iss/IG+
2000-04-11 17:36:06 +00:00
Mississippi
2007-02-09 20:13:18 +00:00
/\Biss\B/IG+
2000-04-11 17:36:06 +00:00
Mississippi
2007-02-09 20:13:18 +00:00
/\Biss\B/Ig+
2000-04-11 17:36:06 +00:00
Mississippi
*** Failers
Mississippi\A
2007-02-09 20:13:18 +00:00
/(?<=[Ms])iss/Ig+
2000-04-11 17:36:06 +00:00
Mississippi
2007-02-09 20:13:18 +00:00
/(?<=[Ms])iss/IG+
2000-04-11 17:36:06 +00:00
Mississippi
2007-02-09 20:13:18 +00:00
/^iss/Ig+
2000-04-11 17:36:06 +00:00
ississippi
2007-02-09 20:13:18 +00:00
/.*iss/Ig+
abciss\nxyzisspqr
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/.i./I+g
2000-04-11 17:36:06 +00:00
Mississippi
Mississippi\A
Missouri river
Missouri river\A
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/^.is/I+g
2000-04-11 17:36:06 +00:00
Mississippi
2007-02-09 20:13:18 +00:00
/^ab\n/Ig+
2000-04-11 17:36:06 +00:00
ab\nab\ncd
2007-02-09 20:13:18 +00:00
/^ab\n/Img+
2000-04-11 17:36:06 +00:00
ab\nab\ncd
2007-02-09 20:13:18 +00:00
/abc/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/abc|bac/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(abc|bac)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(abc|(c|dc))/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(abc|(d|de)c)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a+/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(baa|a+)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a{0,3}/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/baa{3,}/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/"([^\\"]+|\\.)*"/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(abc|ab[cd])/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(a|.)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a|ba|\w/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/abc(?=pqr)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/...(?<=abc)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/abc(?!pqr)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/ab./I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/ab[xyz]/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/abc*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/ab.c*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a.c*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/.c*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/ac*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(a.c*|b.c*)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a.c*|aba/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/.+a/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?=abcda)a.*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/(?=a)a.*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a(b)*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a\d*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/ab\d*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a(\d)*/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/abcde{0,0}/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/ab\d+/I
2000-04-11 17:36:06 +00:00
2008-01-13 12:48:00 +00:00
/a(?(1)b)(.)/I
2000-04-11 17:36:06 +00:00
2008-01-13 12:48:00 +00:00
/a(?(1)bag|big)(.)/I
2000-04-11 17:36:06 +00:00
2008-01-13 12:48:00 +00:00
/a(?(1)bag|big)*(.)/I
2000-04-11 17:36:06 +00:00
2008-01-13 12:48:00 +00:00
/a(?(1)bag|big)+(.)/I
2000-04-11 17:36:06 +00:00
2008-01-13 12:48:00 +00:00
/a(?(1)b..|b..)(.)/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/ab\d{0}e/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/a?b?/I
2000-04-11 17:36:06 +00:00
a
b
ab
\
*** Failers
\N
2007-02-09 20:13:18 +00:00
/|-/I
2000-04-11 17:36:06 +00:00
abcd
-abc
\Nab-c
*** Failers
\Nabc
2000-04-11 17:36:06 +00:00
2009-11-03 12:15:03 +00:00
/a*(b+)(z)(z)/P
2000-04-11 17:36:06 +00:00
aaaabbbbzzzz
aaaabbbbzzzz\O0
aaaabbbbzzzz\O1
aaaabbbbzzzz\O2
aaaabbbbzzzz\O3
aaaabbbbzzzz\O4
aaaabbbbzzzz\O5
/^.?abcd/IS
2000-04-11 17:36:06 +00:00
/\( # ( at start
(?: # Non-capturing bracket
(?>[^()]+) # Either a sequence of non-brackets (no backtracking)
| # Or
(?R) # Recurse - i.e. nested bracketed string
)* # Zero or more contents
\) # Closing )
2007-02-09 20:13:18 +00:00
/Ix
2000-04-11 17:36:06 +00:00
(abcd)
(abcd)xyz
xyz(abcd)
(ab(xy)cd)pqr
(ab(xycd)pqr
() abc ()
2000-04-11 17:36:06 +00:00
12(abcde(fsh)xyz(foo(bar))lmno)89
*** Failers
abcd
2000-04-11 17:36:06 +00:00
abcd)
(abcd
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/\( ( (?>[^()]+) | (?R) )* \) /Ixg
(ab(xy)cd)pqr
2000-04-11 17:36:06 +00:00
1(abcd)(x(y)z)pqr
2007-02-09 20:13:18 +00:00
/\( (?: (?>[^()]+) | (?R) ) \) /Ix
2000-04-11 17:36:06 +00:00
(abcd)
(ab(xy)cd)
(a(b(c)d)e)
((ab))
2000-04-11 17:36:06 +00:00
*** Failers
()
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/\( (?: (?>[^()]+) | (?R) )? \) /Ix
2000-04-11 17:36:06 +00:00
()
12(abcde(fsh)xyz(foo(bar))lmno)89
2007-02-09 20:13:18 +00:00
/\( ( (?>[^()]+) | (?R) )* \) /Ix
2000-04-11 17:36:06 +00:00
(ab(xy)cd)
2007-02-09 20:13:18 +00:00
/\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
2000-04-11 17:36:06 +00:00
(ab(xy)cd)
2007-02-09 20:13:18 +00:00
/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
2000-04-11 17:36:06 +00:00
(ab(xy)cd)
(123ab(xy)cd)
2007-02-09 20:13:18 +00:00
/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
2000-04-11 17:36:06 +00:00
(ab(xy)cd)
(123ab(xy)cd)
2007-02-09 20:13:18 +00:00
/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
2000-04-11 17:36:06 +00:00
(ab(xy)cd)
2007-02-09 20:13:18 +00:00
/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
2000-04-11 17:36:06 +00:00
(abcd(xyz<p>qrs)123)
2007-02-09 20:13:18 +00:00
/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
2000-04-11 17:36:06 +00:00
(ab(cd)ef)
(ab(cd(ef)gh)ij)
/^[[:alnum:]]/DZ
/^[[:^alnum:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:alpha:]]/DZ
/^[[:^alpha:]]/DZ
2006-03-06 21:34:07 +00:00
/[_[:alpha:]]/IS
/^[[:ascii:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:^ascii:]]/DZ
/^[[:blank:]]/DZ
2002-10-15 13:59:58 +00:00
/^[[:^blank:]]/DZ
2006-03-06 21:34:07 +00:00
/[\n\x0b\x0c\x0d[:blank:]]/IS
/^[[:cntrl:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:digit:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:graph:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:lower:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:print:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:punct:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:space:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:upper:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:xdigit:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:word:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:^cntrl:]]/DZ
2000-04-11 17:36:06 +00:00
/^[12[:^digit:]]/DZ
2000-04-11 17:36:06 +00:00
/^[[:^blank:]]/DZ
2002-10-15 13:59:58 +00:00
/[01[:alpha:]%]/DZ
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/[[.ch.]]/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/[[=ch=]]/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/[[:rhubarb:]]/I
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/[[:upper:]]/Ii
2000-04-11 17:36:06 +00:00
A
a
2007-02-09 20:13:18 +00:00
/[[:lower:]]/Ii
2000-04-11 17:36:06 +00:00
A
a
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/((?-i)[[:lower:]])[[:lower:]]/Ii
2000-04-11 17:36:06 +00:00
ab
aB
*** Failers
Ab
AB
2000-04-11 17:36:06 +00:00
2007-02-09 20:13:18 +00:00
/[\200-\110]/I
2001-02-20 22:00:33 +00:00
2007-02-09 20:13:18 +00:00
/^(?(0)f|b)oo/I
2001-02-20 22:00:33 +00:00
2007-02-09 20:13:18 +00:00
/This one's here because of the large output vector needed/I
2007-02-09 20:13:18 +00:00
/(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s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?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
\O900 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC
2007-02-09 20:13:18 +00:00
/This one's here because Perl does this differently and PCRE can't at present/I
2007-02-09 20:13:18 +00:00
/(main(O)?)+/I
mainmain
mainOmain
2007-02-09 20:13:18 +00:00
/These are all cases where Perl does it differently (nested captures)/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(a(b)?)+$/I
2002-10-15 13:59:58 +00:00
aba
2007-02-09 20:13:18 +00:00
/^(aa(bb)?)+$/I
aabbaa
2007-02-09 20:13:18 +00:00
/^(aa|aa(bb))+$/I
aabbaa
2007-02-09 20:13:18 +00:00
/^(aa(bb)??)+$/I
aabbaa
2007-02-09 20:13:18 +00:00
/^(?:aa(bb)?)+$/I
aabbaa
2007-02-09 20:13:18 +00:00
/^(aa(b(b))?)+$/I
aabbaa
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(?:aa(b(b))?)+$/I
aabbaa
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(?:aa(b(?:b))?)+$/I
aabbaa
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(?:aa(bb(?:b))?)+$/I
aabbbaa
2007-02-09 20:13:18 +00:00
/^(?:aa(b(?:bb))?)+$/I
aabbbaa
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(?:aa(?:b(b))?)+$/I
aabbaa
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(?:aa(?:b(bb))?)+$/I
aabbbaa
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(aa(b(bb))?)+$/I
aabbbaa
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(aa(bb(bb))?)+$/I
aabbbbaa
2002-10-15 13:59:58 +00:00
/--------------------------------------------------------------------/I
/#/IxDZ
2002-10-15 13:59:58 +00:00
/a#/IxDZ
2002-10-15 13:59:58 +00:00
/[\s]/DZ
2002-10-15 13:59:58 +00:00
/[\S]/DZ
2002-10-15 13:59:58 +00:00
/a(?i)b/DZ
2002-10-15 13:59:58 +00:00
ab
aB
*** Failers
AB
2002-10-15 13:59:58 +00:00
/(a(?i)b)/DZ
2002-10-15 13:59:58 +00:00
ab
aB
*** Failers
AB
/ (?i)abc/IxDZ
2002-10-15 13:59:58 +00:00
/#this is a comment
(?i)abc/IxDZ
2002-10-15 13:59:58 +00:00
/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
2002-10-15 13:59:58 +00:00
/\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
2002-10-15 13:59:58 +00:00
/\Q\E/DZ
2002-10-15 13:59:58 +00:00
\
/\Q\Ex/DZ
2002-10-15 13:59:58 +00:00
/ \Q\E/DZ
2002-10-15 13:59:58 +00:00
/a\Q\E/DZ
2002-10-15 13:59:58 +00:00
abc
bca
bac
2002-10-15 13:59:58 +00:00
/a\Q\Eb/DZ
2002-10-15 13:59:58 +00:00
abc
/\Q\Eabc/DZ
2002-10-15 13:59:58 +00:00
/x*+\w/DZ
*** Failers
2002-10-15 13:59:58 +00:00
xxxxx
/x?+/DZ
/x++/DZ
2002-10-15 13:59:58 +00:00
/x{1,3}+/DZ
2002-10-15 13:59:58 +00:00
/(x)*+/DZ
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(\w++|\s++)*$/I
2002-10-15 13:59:58 +00:00
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!
2007-02-09 20:13:18 +00:00
/(\d++)(\w)/I
2002-10-15 13:59:58 +00:00
12345a
*** Failers
12345+
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/a++b/I
2002-10-15 13:59:58 +00:00
aaab
2007-02-09 20:13:18 +00:00
/(a++b)/I
2002-10-15 13:59:58 +00:00
aaab
2007-02-09 20:13:18 +00:00
/(a++)b/I
2002-10-15 13:59:58 +00:00
aaab
2007-02-09 20:13:18 +00:00
/([^()]++|\([^()]*\))+/I
2002-10-15 13:59:58 +00:00
((abc(ade)ufh()()x
/\(([^()]++|\([^()]+\))+\)/I
2002-10-15 13:59:58 +00:00
(abc)
(abc(def)xyz)
*** Failers
((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2002-10-15 13:59:58 +00:00
/(abc){1,3}+/DZ
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/a+?+/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/a{2,3}?+b/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(?U)a+?+/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/a{2,3}?+b/IU
2002-10-15 13:59:58 +00:00
/x(?U)a++b/DZ
2002-10-15 13:59:58 +00:00
xaaaab
/(?U)xa++b/DZ
2002-10-15 13:59:58 +00:00
xaaaab
/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/DZ
2002-10-15 13:59:58 +00:00
/^x(?U)a+b/DZ
2002-10-15 13:59:58 +00:00
/^x(?U)(a+)b/DZ
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/[.x.]/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/[=x=]/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/[:x:]/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/\l/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/\L/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/\N{name}/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/\u/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/\U/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/[/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/[a-/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/[[:space:]/I
2002-10-15 13:59:58 +00:00
/[\s]/IDZ
2002-10-15 13:59:58 +00:00
/[[:space:]]/IDZ
2002-10-15 13:59:58 +00:00
/[[:space:]abcde]/IDZ
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
2002-10-15 13:59:58 +00:00
<>
<abcd>
<abc <123> hij>
<abc <def> hij>
<abc<>def>
<abc<>
2002-10-15 13:59:58 +00:00
*** Failers
<abc
|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\/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00:00
/(?=abc)(?i).xyz/I
/(?=a)(?=b)/I
/(?=.)a/I
/((?=abcda)a)/I
/((?=abcda)ab)/I
/()a/I
2008-01-13 12:48:00 +00:00
/(?(1)ab|ac)(.)/I
2002-10-15 13:59:58 +00:00
2008-01-13 12:48:00 +00:00
/(?(1)abz|acz)(.)/I
2002-10-15 13:59:58 +00:00
2008-01-13 12:48:00 +00:00
/(?(1)abz)(.)/I
2002-10-15 13:59:58 +00:00
2008-01-13 12:48:00 +00:00
/(?(1)abz)(1)23/I
2002-10-15 13:59:58 +00:00
/(a)+/I
/(a){2,3}/I
/(a)*/I
/[a]/I
/[ab]/I
/[ab]/IS
/[^a]/I
/\d456/I
/\d456/IS
/a^b/I
2007-02-09 20:13:18 +00:00
/^a/Im
2002-10-15 13:59:58 +00:00
abcde
xy\nabc
*** Failers
xyabc
2002-10-15 13:59:58 +00:00
/c|abc/I
/(?i)[ab]/IS
/[ab](?i)cd/IS
2007-02-09 20:13:18 +00:00
/abc(?C)def/I
2002-10-15 13:59:58 +00:00
abcdef
1234abcdef
2002-10-15 13:59:58 +00:00
*** Failers
abcxyz
abcxyzf
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/abc(?C)de(?C1)f/I
2002-10-15 13:59:58 +00:00
123abcdef
/(?C1)\dabc(?C2)def/I
2002-10-15 13:59:58 +00:00
1234abcdef
*** Failers
abcdef
2007-02-09 20:13:18 +00:00
/(?C255)ab/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(?C256)ab/I
2002-10-15 13:59:58 +00:00
/(?Cab)xx/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(?C12vr)x/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/abc(?C)def/I
2002-10-15 13:59:58 +00:00
*** Failers
\x83\x0\x61bcdef
2007-02-09 20:13:18 +00:00
/(abc)(?C)de(?C1)f/I
2002-10-15 13:59:58 +00:00
123abcdef
123abcdef\C+
123abcdef\C-
2002-10-15 13:59:58 +00:00
*** Failers
123abcdef\C!1
2007-02-09 20:13:18 +00:00
/(?C0)(abc(?C1))*/I
2002-10-15 13:59:58 +00:00
abcabcabc
abcabc\C!1!3
2002-10-15 13:59:58 +00:00
*** Failers
abcabcabc\C!1!3
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(\d{3}(?C))*/I
2002-10-15 13:59:58 +00:00
123\C+
123456\C+
123456789\C+
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/((xyz)(?C)p|(?C1)xyzabc)/I
2002-10-15 13:59:58 +00:00
xyzabc\C+
2007-02-09 20:13:18 +00:00
/(X)((xyz)(?C)p|(?C1)xyzabc)/I
2002-10-15 13:59:58 +00:00
Xxyzabc\C+
2007-02-09 20:13:18 +00:00
/(?=(abc))(?C)abcdef/I
2002-10-15 13:59:58 +00:00
abcdef\C+
2007-02-09 20:13:18 +00:00
/(?!(abc)(?C1)d)(?C2)abcxyz/I
abcxyz\C+
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(?<=(abc)(?C))xyz/I
2002-10-15 13:59:58 +00:00
abcxyz\C+
2007-02-09 20:13:18 +00:00
/a(b+)(c*)(?C1)/I
abbbbbccc\C*1
2007-02-09 20:13:18 +00:00
/a(b+?)(c*?)(?C1)/I
abbbbbccc\C*1
/(?C)abc/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(?C)^abc/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(?C)a|b/IS
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(?R)/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(a|(?R))/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(ab|(bc|(de|(?R))))/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/x(ab|(bc|(de|(?R))))/I
2002-10-15 13:59:58 +00:00
xab
xbc
xde
xxab
xxxab
*** Failers
xyab
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/(ab|(bc|(de|(?1))))/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/x(ab|(bc|(de|(?1)x)x)x)/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^([^()]|\((?1)*\))*$/I
2002-10-15 13:59:58 +00:00
abc
a(b)c
a(b(c))d
2002-10-15 13:59:58 +00:00
*** Failers)
a(b(c)d
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^>abc>([^()]|\((?1)*\))*<xyz<$/I
2002-10-15 13:59:58 +00:00
>abc>123<xyz<
>abc>1(2)3<xyz<
>abc>(1(2)3)<xyz<
/(a(?1)b)/DZ
2002-10-15 13:59:58 +00:00
/(a(?1)+b)/DZ
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
2002-10-15 13:59:58 +00:00
12
(((2+2)*-3)-7)
-12
*** Failers
((2+2)*-3)-7)
2007-02-09 20:13:18 +00:00
/^(x(y|(?1){2})z)/I
2002-10-15 13:59:58 +00:00
xyz
xxyzxyzz
2002-10-15 13:59:58 +00:00
*** Failers
xxyzz
xxyzxyzxyzz
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
2002-10-15 13:59:58 +00:00
<>
<abcd>
<abc <123> hij>
<abc <def> hij>
<abc<>def>
<abc<>
2002-10-15 13:59:58 +00:00
*** Failers
<abc
2007-02-09 20:13:18 +00:00
/(?1)/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/((?2)(abc)/I
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(abc)def(?1)/I
2002-10-15 13:59:58 +00:00
abcdefabc
2007-02-09 20:13:18 +00:00
/^(a|b|c)=(?1)+/I
2002-10-15 13:59:58 +00:00
a=a
a=b
a=bc
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^(a|b|c)=((?1))+/I
2002-10-15 13:59:58 +00:00
a=a
a=b
a=bc
2002-10-15 13:59:58 +00:00
/a(?P<name1>b|c)d(?P<longername2>e)/DZ
2002-10-15 13:59:58 +00:00
abde
acde
2002-10-15 13:59:58 +00:00
/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/DZ
2002-10-15 13:59:58 +00:00
/(?P<a>a)...(?P=a)bbb(?P>a)d/DZ
2002-10-15 13:59:58 +00:00
2007-02-09 20:13:18 +00:00
/^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
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
2007-02-09 20:13:18 +00:00
/((?(R)a|b))\1(?1)?/I
bb
bbaa
2007-02-09 20:13:18 +00:00
/(.*)a/Is
2007-02-09 20:13:18 +00:00
/(.*)a\1/Is
2007-02-09 20:13:18 +00:00
/(.*)a(b)\2/Is
2007-02-09 20:13:18 +00:00
/((.*)a|(.*)b)z/Is
2007-02-09 20:13:18 +00:00
/((.*)a|(.*)b)z\1/Is
2007-02-09 20:13:18 +00:00
/((.*)a|(.*)b)z\2/Is
2007-02-09 20:13:18 +00:00
/((.*)a|(.*)b)z\3/Is
2007-02-09 20:13:18 +00:00
/((.*)a|^(.*)b)z\3/Is
2007-02-09 20:13:18 +00:00
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
2007-02-09 20:13:18 +00:00
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
2007-02-09 20:13:18 +00:00
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
/(a)(bc)/INDZ
abc
/(?P<one>a)(bc)/INDZ
abc
/(a)(?P<named>bc)/INDZ
2007-02-09 20:13:18 +00:00
/(a+)*zz/I
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
aaaaaaaaaaaaaz\M
2007-02-09 20:13:18 +00:00
/(aaa(?C1)bbb|ab)/I
aaabbb
aaabbb\C*0
aaabbb\C*1
aaabbb\C*-1
2007-02-09 20:13:18 +00:00
/ab(?P<one>cd)ef(?P<two>gh)/I
abcdefgh
abcdefgh\C1\Gtwo
abcdefgh\Cone\Ctwo
abcdefgh\Cthree
/(?P<Tes>)(?P<Test>)/DZ
/(?P<Test>)(?P<Tes>)/DZ
2007-02-09 20:13:18 +00:00
/(?P<Z>zz)(?P<A>aa)/I
zzaa\CZ
zzaa\CA
2007-02-09 20:13:18 +00:00
/(?P<x>eks)(?P<x>eccs)/I
2007-02-09 20:13:18 +00:00
/(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
2007-02-09 20:13:18 +00:00
"\[((?P<elem>\d+)(,(?P>elem))*)\]"I
[10,20,30,5,5,4,4,2,43,23,4234]
*** Failers
[]
2007-02-09 20:13:18 +00:00
"\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
[10,20,30,5,5,4,4,2,43,23,4234]
[]
/(a(b(?2)c))?/DZ
/(a(b(?2)c))*/DZ
/(a(b(?2)c)){0,2}/DZ
/[ab]{1}+/DZ
2007-02-09 20:13:18 +00:00
/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
Baby Bjorn Active Carrier - With free SHIPPING!!
2007-02-09 20:13:18 +00:00
/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS
Baby Bjorn Active Carrier - With free SHIPPING!!
/a*.*b/ISDZ
/(a|b)*.?c/ISDZ
/abc(?C255)de(?C)f/DZ
/abcde/ICDZ
abcde
abcdfe
/a*b/ICDZ
ab
aaaab
aaaacb
/a+b/ICDZ
ab
aaaab
aaaacb
/(abc|def)x/ICDZ
abcx
defx
abcdefzx
2007-02-09 20:13:18 +00:00
/(ab|cd){3,4}/IC
ababab
abcdabcd
abcdcdcdcdcd
/([ab]{,4}c|xy)/ICDZ
Note: that { does NOT introduce a quantifier
/([ab]{1,4}c|xy){4,5}?123/ICDZ
aacaacaacaacaac123
/\b.*/I
ab cd\>1
/\b.*/Is
ab cd\>1
/(?!.bcd).*/I
Xbcd12345
2007-02-09 20:13:18 +00:00
/abcde/I
ab\P
abc\P
abcd\P
abcde\P
the quick brown abc\P
** Failers\P
the quick brown abxyz fox\P
2007-02-09 20:13:18 +00:00
"^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
13/05/04\P
13/5/2004\P
02/05/09\P
1\P
1/2\P
1/2/0\P
1/2/04\P
0\P
02/\P
02/0\P
02/1\P
** Failers\P
\P
123\P
33/4/04\P
3/13/04\P
0/1/2003\P
0/\P
02/0/\P
02/13\P
/0{0,2}ABC/I
/\d{3,}ABC/I
/\d*ABC/I
/[abc]+DE/I
2007-02-09 20:13:18 +00:00
/[abc]?123/I
123\P
a\P
b\P
c\P
c12\P
c123\P
2007-02-09 20:13:18 +00:00
/^(?:\d){3,5}X/I
1\P
123\P
123X
1234\P
1234X
12345\P
12345X
*** Failers
1X
123456\P
2007-02-09 20:13:18 +00:00
/abc/I>testsavedregex
<testsavedregex
abc
** Failers
bca
2007-02-09 20:13:18 +00:00
/abc/IF>testsavedregex
<testsavedregex
abc
** Failers
bca
2007-02-09 20:13:18 +00:00
/(a|b)/IS>testsavedregex
<testsavedregex
abc
** Failers
def
2007-02-09 20:13:18 +00:00
/(a|b)/ISF>testsavedregex
<testsavedregex
abc
** Failers
def
2007-02-09 20:13:18 +00:00
~<(\w+)/?>(.)*</(\1)>~smgI
<!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>
/^a/IF
2007-02-09 20:13:18 +00:00
/line\nbreak/I
this is a line\nbreak
line one\nthis is a line\nbreak in the second line
2007-02-09 20:13:18 +00:00
/line\nbreak/If
this is a line\nbreak
** Failers
line one\nthis is a line\nbreak in the second line
2007-02-09 20:13:18 +00:00
/line\nbreak/Imf
this is a line\nbreak
** Failers
line one\nthis is a line\nbreak in the second line
2009-11-03 12:15:03 +00:00
/ab.cd/P
ab-cd
ab=cd
** Failers
ab\ncd
2009-11-03 12:15:03 +00:00
/ab.cd/Ps
ab-cd
ab=cd
ab\ncd
2007-02-09 20:13:18 +00:00
/(?i)(?-i)AbCd/I
AbCd
** Failers
abcd
2007-02-09 20:13:18 +00:00
/a{11111111111111111111}/I
2007-02-09 20:13:18 +00:00
/(){64294967295}/I
2007-02-09 20:13:18 +00:00
/(){2,4294967295}/I
2007-02-09 20:13:18 +00:00
"(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
abcdefghijklAkB
2007-02-09 20:13:18 +00:00
"(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B"I
abcdefghijklAkB
2007-02-09 20:13:18 +00:00
"(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
abcdefghijklAkB
2007-02-09 20:13:18 +00:00
"(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)"I
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2007-02-09 20:13:18 +00:00
"(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)"I
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2007-02-09 20:13:18 +00:00
/[^()]*(?:\((?R)\)[^()]*)*/I
2006-03-06 21:34:07 +00:00
(this(and)that
(this(and)that)
2006-03-06 21:34:07 +00:00
(this(and)that)stuff
2007-02-09 20:13:18 +00:00
/[^()]*(?:\((?>(?R))\)[^()]*)*/I
2006-03-06 21:34:07 +00:00
(this(and)that
(this(and)that)
2007-02-09 20:13:18 +00:00
/[^()]*(?:\((?R)\))*[^()]*/I
2006-03-06 21:34:07 +00:00
(this(and)that
(this(and)that)
2006-03-06 21:34:07 +00:00
2007-02-09 20:13:18 +00:00
/(?:\((?R)\))*[^()]*/I
2006-03-06 21:34:07 +00:00
(this(and)that
(this(and)that)
((this))
2006-03-06 21:34:07 +00:00
2007-02-09 20:13:18 +00:00
/(?:\((?R)\))|[^()]*/I
2006-03-06 21:34:07 +00:00
(this(and)that
(this(and)that)
2006-03-06 21:34:07 +00:00
(this)
((this))
2009-11-03 12:15:03 +00:00
/a(b)c/PN
2006-03-06 21:34:07 +00:00
abc
2009-11-03 12:15:03 +00:00
/a(?P<name>b)c/PN
abc
/\x{100}/I
2006-03-06 21:34:07 +00:00
2007-02-09 20:13:18 +00:00
/\x{0000ff}/I
2006-03-06 21:34:07 +00:00
2007-02-09 20:13:18 +00:00
/^((?P<A>a1)|(?P<A>a2)b)/I
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/^((?P<A>a1)|(?P<A>a2)b)/IJ
2006-08-30 20:00:59 +00:00
a1b\CA
a2b\CA
2006-08-30 20:00:59 +00:00
** Failers
a1b\CZ\CA
2007-02-09 20:13:18 +00:00
/^(?P<A>a)(?P<A>b)/IJ
2006-08-30 20:00:59 +00:00
ab\CA
2007-02-09 20:13:18 +00:00
/^(?P<A>a)(?P<A>b)|cd/IJ
2006-08-30 20:00:59 +00:00
ab\CA
cd\CA
2007-02-09 20:13:18 +00:00
/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
cdefgh\CA
2007-02-09 20:13:18 +00:00
/^((?P<A>a1)|(?P<A>a2)b)/IJ
2006-08-30 20:00:59 +00:00
a1b\GA
a2b\GA
2006-08-30 20:00:59 +00:00
** Failers
a1b\GZ\GA
2007-02-09 20:13:18 +00:00
/^(?P<A>a)(?P<A>b)/IJ
2006-08-30 20:00:59 +00:00
ab\GA
2007-02-09 20:13:18 +00:00
/^(?P<A>a)(?P<A>b)|cd/IJ
2006-08-30 20:00:59 +00:00
ab\GA
cd\GA
2007-02-09 20:13:18 +00:00
/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
cdefgh\GA
2007-02-09 20:13:18 +00:00
/(?J)^((?P<A>a1)|(?P<A>a2)b)/I
2006-08-30 20:00:59 +00:00
a1b\CA
a2b\CA
2007-02-09 20:13:18 +00:00
/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
2006-08-30 20:00:59 +00:00
/ In this next test, J is not set at the outer level; consequently it isn't
set in the pattern's options; consequently pcre_get_named_substring() produces
2007-02-09 20:13:18 +00:00
a random value. /Ix
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
2006-08-30 20:00:59 +00:00
a bc d\CA\CB\CC
2007-02-09 20:13:18 +00:00
/^(?P<A>a)?(?(A)a|b)/I
2006-08-30 20:00:59 +00:00
aabc
bc
** Failers
abc
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
2006-08-30 20:00:59 +00:00
bXaX
2007-02-09 20:13:18 +00:00
/(?:(?(2y)a|b)(X))+/I
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/(?:(?(ZA)a|b)(?P<ZZ>X))+/I
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
2006-08-30 20:00:59 +00:00
bbXaaX
2007-02-09 20:13:18 +00:00
/(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
2006-08-30 20:00:59 +00:00
(b)\\Xa\\X
2007-02-09 20:13:18 +00:00
/(?P<ABC/I
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
2006-08-30 20:00:59 +00:00
bXXaYYaY
bXYaXXaX
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
2006-08-30 20:00:59 +00:00
bXXaYYaY
2007-02-09 20:13:18 +00:00
/\777/I
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/\s*,\s*/IS
2006-08-30 20:00:59 +00:00
\x0b,\x0b
\x0c,\x0d
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/^abc/Im
2006-08-30 20:00:59 +00:00
xyz\nabc
xyz\nabc\<lf>
xyz\r\nabc\<lf>
xyz\rabc\<cr>
xyz\r\nabc\<crlf>
** Failers
2006-08-30 20:00:59 +00:00
xyz\nabc\<cr>
xyz\r\nabc\<cr>
xyz\nabc\<crlf>
xyz\rabc\<crlf>
xyz\rabc\<lf>
2007-02-09 20:13:18 +00:00
/abc$/Im<lf>
2006-08-30 20:00:59 +00:00
xyzabc
xyzabc\n
xyzabc\npqr
xyzabc\r\<cr>
xyzabc\rpqr\<cr>
xyzabc\r\n\<crlf>
xyzabc\r\npqr\<crlf>
2006-08-30 20:00:59 +00:00
** Failers
xyzabc\r
xyzabc\rpqr
xyzabc\r\n
xyzabc\r\npqr
2007-02-09 20:13:18 +00:00
/^abc/Im<cr>
2006-08-30 20:00:59 +00:00
xyz\rabcdef
xyz\nabcdef\<lf>
** Failers
2006-08-30 20:00:59 +00:00
xyz\nabcdef
2007-02-09 20:13:18 +00:00
/^abc/Im<lf>
2006-08-30 20:00:59 +00:00
xyz\nabcdef
xyz\rabcdef\<cr>
** Failers
2006-08-30 20:00:59 +00:00
xyz\rabcdef
2007-02-09 20:13:18 +00:00
/^abc/Im<crlf>
2006-08-30 20:00:59 +00:00
xyz\r\nabcdef
xyz\rabcdef\<cr>
** Failers
2006-08-30 20:00:59 +00:00
xyz\rabcdef
2007-02-09 20:13:18 +00:00
/^abc/Im<bad>
2006-08-30 20:00:59 +00:00
2007-02-09 20:13:18 +00:00
/abc/I
2006-08-30 20:00:59 +00:00
xyz\rabc\<bad>
abc
2007-02-09 20:13:18 +00:00
/.*/I<lf>
2006-08-30 20:00:59 +00:00
abc\ndef
abc\rdef
abc\r\ndef
\<cr>abc\ndef
\<cr>abc\rdef
\<cr>abc\r\ndef
\<crlf>abc\ndef
\<crlf>abc\rdef
\<crlf>abc\r\ndef
2007-02-09 20:13:18 +00:00
/\w+(.)(.)?def/Is
2006-08-30 20:00:59 +00:00
abc\ndef
abc\rdef
abc\r\ndef
2007-02-09 20:13:18 +00:00
+((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I
2006-08-30 20:00:59 +00:00
/* this is a C style comment */\M
2007-02-09 20:13:18 +00:00
/(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
/()()()()()()()()()()()()()()()()()()()()
()()()()()()()()()()()()()()()()()()()()
()()()()()()()()()()()()()()()()()()()()
()()()()()()()()()()()()()()()()()()()()
()()()()()()()()()()()()()()()()()()()()
(.(.))/Ix
XY\O400
2007-02-09 20:13:18 +00:00
/(a*b|(?i:c*(?-i)d))/IS
/()[ab]xyz/IS
/(|)[ab]xyz/IS
/(|c)[ab]xyz/IS
/(|c?)[ab]xyz/IS
/(d?|c?)[ab]xyz/IS
/(d?|c)[ab]xyz/IS
/^a*b\d/DZ
2007-02-09 20:13:18 +00:00
/^a*+b\d/DZ
2007-02-09 20:13:18 +00:00
/^a*?b\d/DZ
2007-02-09 20:13:18 +00:00
/^a+A\d/DZ
2007-02-09 20:13:18 +00:00
aaaA5
** Failers
aaaa5
2007-02-09 20:13:18 +00:00
/^a*A\d/IiDZ
2007-02-09 20:13:18 +00:00
aaaA5
aaaa5
/(a*|b*)[cd]/IS
/(a+|b*)[cd]/IS
/(a*|b+)[cd]/IS
/(a+|b+)[cd]/IS
/((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
(((
a
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))
/Ix
2007-02-09 20:13:18 +00:00
large nest
/a*\d/BZ
2007-02-09 20:13:18 +00:00
/a*\D/BZ
2007-02-09 20:13:18 +00:00
/0*\d/BZ
2007-02-09 20:13:18 +00:00
/0*\D/BZ
2007-02-09 20:13:18 +00:00
/a*\s/BZ
2007-02-09 20:13:18 +00:00
/a*\S/BZ
2007-02-09 20:13:18 +00:00
/ *\s/BZ
2007-02-09 20:13:18 +00:00
/ *\S/BZ
2007-02-09 20:13:18 +00:00
/a*\w/BZ
2007-02-09 20:13:18 +00:00
/a*\W/BZ
2007-02-09 20:13:18 +00:00
/=*\w/BZ
2007-02-09 20:13:18 +00:00
/=*\W/BZ
2007-02-09 20:13:18 +00:00
/\d*a/BZ
2007-02-09 20:13:18 +00:00
/\d*2/BZ
2007-02-09 20:13:18 +00:00
/\d*\d/BZ
2007-02-09 20:13:18 +00:00
/\d*\D/BZ
2007-02-09 20:13:18 +00:00
/\d*\s/BZ
2007-02-09 20:13:18 +00:00
/\d*\S/BZ
2007-02-09 20:13:18 +00:00
/\d*\w/BZ
2007-02-09 20:13:18 +00:00
/\d*\W/BZ
2007-02-09 20:13:18 +00:00
/\D*a/BZ
2007-02-09 20:13:18 +00:00
/\D*2/BZ
2007-02-09 20:13:18 +00:00
/\D*\d/BZ
2007-02-09 20:13:18 +00:00
/\D*\D/BZ
2007-02-09 20:13:18 +00:00
/\D*\s/BZ
2007-02-09 20:13:18 +00:00
/\D*\S/BZ
2007-02-09 20:13:18 +00:00
/\D*\w/BZ
2007-02-09 20:13:18 +00:00
/\D*\W/BZ
2007-02-09 20:13:18 +00:00
/\s*a/BZ
2007-02-09 20:13:18 +00:00
/\s*2/BZ
2007-02-09 20:13:18 +00:00
/\s*\d/BZ
2007-02-09 20:13:18 +00:00
/\s*\D/BZ
2007-02-09 20:13:18 +00:00
/\s*\s/BZ
2007-02-09 20:13:18 +00:00
/\s*\S/BZ
2007-02-09 20:13:18 +00:00
/\s*\w/BZ
2007-02-09 20:13:18 +00:00
/\s*\W/BZ
2007-02-09 20:13:18 +00:00
/\S*a/BZ
2007-02-09 20:13:18 +00:00
/\S*2/BZ
2007-02-09 20:13:18 +00:00
/\S*\d/BZ
2007-02-09 20:13:18 +00:00
/\S*\D/BZ
2007-02-09 20:13:18 +00:00
/\S*\s/BZ
2007-02-09 20:13:18 +00:00
/\S*\S/BZ
2007-02-09 20:13:18 +00:00
/\S*\w/BZ
2007-02-09 20:13:18 +00:00
/\S*\W/BZ
2007-02-09 20:13:18 +00:00
/\w*a/BZ
2007-02-09 20:13:18 +00:00
/\w*2/BZ
2007-02-09 20:13:18 +00:00
/\w*\d/BZ
2007-02-09 20:13:18 +00:00
/\w*\D/BZ
2007-02-09 20:13:18 +00:00
/\w*\s/BZ
2007-02-09 20:13:18 +00:00
/\w*\S/BZ
2007-02-09 20:13:18 +00:00
/\w*\w/BZ
2007-02-09 20:13:18 +00:00
/\w*\W/BZ
2007-02-09 20:13:18 +00:00
/\W*a/BZ
2007-02-09 20:13:18 +00:00
/\W*2/BZ
2007-02-09 20:13:18 +00:00
/\W*\d/BZ
2007-02-09 20:13:18 +00:00
/\W*\D/BZ
2007-02-09 20:13:18 +00:00
/\W*\s/BZ
2007-02-09 20:13:18 +00:00
/\W*\S/BZ
2007-02-09 20:13:18 +00:00
/\W*\w/BZ
2007-02-09 20:13:18 +00:00
/\W*\W/BZ
2007-02-09 20:13:18 +00:00
/[^a]+a/BZ
2007-02-09 20:13:18 +00:00
/[^a]+a/BZi
2007-02-09 20:13:18 +00:00
/[^a]+A/BZi
2007-02-09 20:13:18 +00:00
/[^a]+b/BZ
2007-02-09 20:13:18 +00:00
/[^a]+\d/BZ
2007-02-09 20:13:18 +00:00
/a*[^a]/BZ
2007-02-09 20:13:18 +00:00
/(?P<abc>x)(?P<xyz>y)/I
xy\Cabc\Cxyz
/(?<abc>x)(?'xyz'y)/I
xy\Cabc\Cxyz
/(?<abc'x)(?'xyz'y)/I
/(?<abc>x)(?'xyz>y)/I
/(?P'abc'x)(?P<xyz>y)/I
/^(?:(?(ZZ)a|b)(?<ZZ>X))+/
bXaX
bXbX
** Failers
aXaX
aXbX
2007-02-09 20:13:18 +00:00
/^(?P>abc)(?<abcd>xxx)/
/^(?P>abc)(?<abc>x|y)/
xx
xy
yy
yx
2007-02-09 20:13:18 +00:00
/^(?P>abc)(?P<abc>x|y)/
xx
xy
yy
yx
2007-02-09 20:13:18 +00:00
/^((?(abc)a|b)(?<abc>x|y))+/
bxay
bxby
2007-02-09 20:13:18 +00:00
** Failers
axby
2007-02-09 20:13:18 +00:00
/^(((?P=abc)|X)(?<abc>x|y))+/
XxXxxx
XxXyyx
XxXyxx
** Failers
x
2007-02-09 20:13:18 +00:00
/^(?1)(abc)/
abcabc
/^(?:(?:\1|X)(a|b))+/
Xaaa
Xaba
2007-02-09 20:13:18 +00:00
/^[\E\Qa\E-\Qz\E]+/BZ
/^[a\Q]bc\E]/BZ
2007-02-09 20:13:18 +00:00
/^[a-\Q\E]/BZ
2007-02-09 20:13:18 +00:00
/^(?P>abc)[()](?<abc>)/BZ
/^((?(abc)y)[()](?P<abc>x))+/BZ
2007-02-09 20:13:18 +00:00
(xy)x
/^(?P>abc)\Q()\E(?<abc>)/BZ
/^(?P>abc)[a\Q(]\E(](?<abc>)/BZ
2007-02-09 20:13:18 +00:00
/^(?P>abc) # this is (a comment)
(?<abc>)/BZx
2007-02-09 20:13:18 +00:00
/^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
1221
Satan, oscillate my metallic sonatas!
A man, a plan, a canal: Panama!
Able was I ere I saw Elba.
2007-02-09 20:13:18 +00:00
*** Failers
The quick brown fox
2007-02-09 20:13:18 +00:00
/(?=(\w+))\1:/I
abcd:
/(?=(?'abc'\w+))\k<abc>:/I
abcd:
/(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
adaa
** Failers
addd
adbb
2007-02-09 20:13:18 +00:00
/(?'abc'a|b)(?<abc>d|e)(?&abc){2}/J
bdaa
bdab
** Failers
bddd
2007-02-09 20:13:18 +00:00
/(?(<bc))/
/(?(''))/
2007-02-09 20:13:18 +00:00
/(?('R')stuff)/
/((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
abcabc1Xabc2XabcXabcabc
/(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
abcabc1Xabc2XabcXabcabc
/(?<A> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
/(?<1> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
abcabc1Xabc2XabcXabcabc
/^(?(DEFINE) abc | xyz ) /x
2007-02-09 20:13:18 +00:00
/(?(DEFINE) abc) xyz/xI
/(?(DEFINE) abc){3} xyz/x
/(a|)*\d/
\O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
\O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
/^a.b/<lf>
a\rb
a\nb\<cr>
a\x85b\<anycrlf>
2007-02-09 20:13:18 +00:00
** Failers
a\nb
a\nb\<any>
a\rb\<cr>
a\rb\<any>
a\x85b\<any>
a\rb\<anycrlf>
2007-02-09 20:13:18 +00:00
/^abc./mgx<any>
2008-09-14 14:37:14 +00:00
abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
2007-02-09 20:13:18 +00:00
/abc.$/mgx<any>
2008-09-14 14:37:14 +00:00
abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
2007-02-09 20:13:18 +00:00
/a/<cr><any>
/a/<any><crlf>
2008-01-13 12:48:00 +00:00
/^a\Rb/<bsr_unicode>
2007-02-09 20:13:18 +00:00
a\nb
a\rb
a\r\nb
a\x0bb
a\x0cb
a\x85b
2007-02-09 20:13:18 +00:00
** Failers
a\n\rb
2007-02-09 20:13:18 +00:00
2008-01-13 12:48:00 +00:00
/^a\R*b/<bsr_unicode>
2007-02-09 20:13:18 +00:00
ab
a\nb
a\rb
a\r\nb
a\x0bb
a\x0cb
a\x85b
a\n\rb
a\n\r\x85\x0cb
2007-02-09 20:13:18 +00:00
2008-01-13 12:48:00 +00:00
/^a\R+b/<bsr_unicode>
2007-02-09 20:13:18 +00:00
a\nb
a\rb
a\r\nb
a\x0bb
a\x0cb
a\x85b
a\n\rb
a\n\r\x85\x0cb
2007-02-09 20:13:18 +00:00
** Failers
ab
2008-01-13 12:48:00 +00:00
/^a\R{1,3}b/<bsr_unicode>
2007-02-09 20:13:18 +00:00
a\nb
a\n\rb
a\n\r\x85b
a\r\n\r\nb
a\r\n\r\n\r\nb
2007-02-09 20:13:18 +00:00
a\n\r\n\rb
a\n\n\r\nb
2007-02-09 20:13:18 +00:00
** Failers
a\n\n\n\rb
a\r
2008-01-13 12:48:00 +00:00
/^a[\R]b/<bsr_unicode>
2007-02-09 20:13:18 +00:00
aRb
** Failers
a\nb
2007-02-09 20:13:18 +00:00
/(?&abc)X(?<abc>P)/I
abcPXP123
/(?1)X(?<abc>P)/I
abcPXP123
/(?:a(?&abc)b)*(?<abc>x)/
123axbaxbaxbx456
123axbaxbaxb456
2007-02-09 20:13:18 +00:00
/(?:a(?&abc)b){1,5}(?<abc>x)/
123axbaxbaxbx456
/(?:a(?&abc)b){2,5}(?<abc>x)/
123axbaxbaxbx456
/(?:a(?&abc)b){2,}(?<abc>x)/
123axbaxbaxbx456
/(abc)(?i:(?1))/
defabcabcxyz
DEFabcABCXYZ
/(abc)(?:(?i)(?1))/
defabcabcxyz
DEFabcABCXYZ
/^(a)\g-2/
/^(a)\g/
/^(a)\g{0}/
/^(a)\g{3/
/^(a)\g{4a}/
/^a.b/<lf>
a\rb
*** Failers
a\nb
/.+foo/
afoo
** Failers
\r\nfoo
\nfoo
2007-02-09 20:13:18 +00:00
/.+foo/<crlf>
afoo
\nfoo
** Failers
\r\nfoo
2007-02-09 20:13:18 +00:00
/.+foo/<any>
afoo
** Failers
\nfoo
\r\nfoo
2007-02-09 20:13:18 +00:00
/.+foo/s
afoo
\r\nfoo
\nfoo
/^$/mg<any>
abc\r\rxyz
abc\n\rxyz
** Failers
abc\r\nxyz
/(?m)^$/<any>g+
abc\r\n\r\n
/(?m)^$|^\r\n/<any>g+
abc\r\n\r\n
/(?m)$/<any>g+
abc\r\n\r\n
/abc.$/mgx<anycrlf>
2008-09-14 14:37:14 +00:00
abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
/^X/m
XABC
** Failers
XABC\B
2006-08-30 20:00:59 +00:00
/(ab|c)(?-1)/BZ
abc
/xy(?+1)(abc)/BZ
xyabcabc
** Failers
xyabc
/x(?-0)y/
/x(?-1)y/
/x(?+0)y/
/x(?+1)y/
/^(abc)?(?(-1)X|Y)/BZ
abcX
Y
** Failers
abcY
/^((?(+1)X|Y)(abc))+/BZ
YabcXabc
YabcXabcXabc
** Failers
XabcXabc
/(?(-1)a)/BZ
/((?(-1)a))/BZ
/((?(-2)a))/BZ
2008-01-13 12:48:00 +00:00
/^(?(+1)X|Y)(.)/BZ
Y!
/(?<A>tom|bon)-\k{A}/
tom-tom
bon-bon
** Failers
tom-bon
/\g{A/
/(?|(abc)|(xyz))/BZ
>abc<
>xyz<
/(x)(?|(abc)|(xyz))(x)/BZ
xabcx
xxyzx
/(x)(?|(abc)(pqr)|(xyz))(x)/BZ
xabcpqrx
xxyzx
/[\h]/BZ
>\x09<
/[\h]+/BZ
>\x09\x20\xa0<
/[\v]/BZ
/[\H]/BZ
/[^\h]/BZ
/[\V]/BZ
/[\x0a\V]/BZ
/\H++X/BZ
** Failers
XXXX
/\H+\hY/BZ
XXXX Y
/\H+ Y/BZ
/\h+A/BZ
/\v*B/BZ
/\V+\x0a/BZ
/A+\h/BZ
/ *\H/BZ
/A*\v/BZ
/\x0b*\V/BZ
/\d+\h/BZ
/\d*\v/BZ
/S+\h\S+\v/BZ
/\w{3,}\h\w+\v/BZ
/\h+\d\h+\w\h+\S\h+\H/BZ
/\v+\d\v+\w\v+\S\v+\V/BZ
/\H+\h\H+\d/BZ
/\V+\v\V+\w/BZ
2007-09-01 18:01:44 +00:00
/\( (?: [^()]* | (?R) )* \)/x
(0(0(0(0(0(0(0(0(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T)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ
/^a+(*FAIL)/C
aaaaaa
/a+b?c+(*FAIL)/C
aaabccc
/a+b?(*PRUNE)c+(*FAIL)/C
aaabccc
/a+b?(*COMMIT)c+(*FAIL)/C
aaabccc
/a+b?(*SKIP)c+(*FAIL)/C
aaabcccaaabccc
/a+b?(*THEN)c+(*FAIL)/C
aaabccc
/a(*MARK)b/
/(?i:A{1,}\6666666666)/
/\g6666666666/
/[\g6666666666]/
/(?1)\c[/
/.+A/<crlf>
\r\nA
/\nA/<crlf>
\r\nA
/[\r\n]A/<crlf>
\r\nA
/(\r|\n)A/<crlf>
\r\nA
/a(*CR)b/
/(*CR)a.b/
a\nb
** Failers
a\rb
/(*CR)a.b/<lf>
a\nb
** Failers
a\rb
/(*LF)a.b/<CRLF>
a\rb
** Failers
a\nb
/(*CRLF)a.b/
a\rb
a\nb
** Failers
a\r\nb
/(*ANYCRLF)a.b/<CR>
** Failers
a\rb
a\nb
a\r\nb
/(*ANY)a.b/<cr>
** Failers
a\rb
a\nb
a\r\nb
a\x85b
2011-05-13 07:00:45 +00:00
/(*ANY).*/g
abc\r\ndef
/(*ANYCRLF).*/g
abc\r\ndef
/(*CRLF).*/g
abc\r\ndef
2007-09-01 18:01:44 +00:00
2008-01-13 12:48:00 +00:00
/a\Rb/I<bsr_anycrlf>
a\rb
a\nb
a\r\nb
** Failers
a\x85b
a\x0bb
/a\Rb/I<bsr_unicode>
a\rb
a\nb
a\r\nb
a\x85b
a\x0bb
** Failers
a\x85b\<bsr_anycrlf>
a\x0bb\<bsr_anycrlf>
/a\R?b/I<bsr_anycrlf>
a\rb
a\nb
a\r\nb
** Failers
a\x85b
a\x0bb
/a\R?b/I<bsr_unicode>
a\rb
a\nb
a\r\nb
a\x85b
a\x0bb
** Failers
a\x85b\<bsr_anycrlf>
a\x0bb\<bsr_anycrlf>
/a\R{2,4}b/I<bsr_anycrlf>
a\r\n\nb
a\n\r\rb
a\r\n\r\n\r\n\r\nb
** Failers
a\x85\85b
a\x0b\0bb
/a\R{2,4}b/I<bsr_unicode>
a\r\rb
a\n\n\nb
a\r\n\n\r\rb
a\x85\85b
a\x0b\0bb
** Failers
a\r\r\r\r\rb
a\x85\85b\<bsr_anycrlf>
a\x0b\0bb\<bsr_anycrlf>
/(*BSR_ANYCRLF)a\Rb/I
a\nb
a\rb
/(*BSR_UNICODE)a\Rb/I
a\x85b
/(*BSR_ANYCRLF)(*CRLF)a\Rb/I
a\nb
a\rb
/(*CRLF)(*BSR_UNICODE)a\Rb/I
a\x85b
/(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
/(?<a>)(?&)/
/(?<abc>)(?&a)/
/(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
/(?+-a)/
/(?-+a)/
/(?(-1))/
/(?(+10))/
/(?(10))/
/(?(+2))()()/
/(?(2))()()/
/\k''/
/\k<>/
/\k{}/
/(?P=)/
/(?P>)/
/(?!\w)(?R)/
/(?=\w)(?R)/
/(?<!\w)(?R)/
/(?<=\w)(?R)/
/[[:foo:]]/
/[[:1234:]]/
/[[:f\oo:]]/
/[[: :]]/
/[[:...:]]/
/[[:l\ower:]]/
/[[:abc\:]]/
/[abc[:x\]pqr:]]/
/[[:a\dz:]]/
2008-07-06 15:18:00 +00:00
/(^(a|b\g<-1'c))/
/^(?+1)(?<a>x|y){0}z/
xzxx
yzyy
** Failers
xxz
/(\3)(\1)(a)/
cat
/(\3)(\1)(a)/<JS>
cat
/TA]/
The ACTA] comes
/TA]/<JS>
The ACTA] comes
/(?2)[]a()b](abc)/
abcbabc
/(?2)[^]a()b](abc)/
abcbabc
/(?1)[]a()b](abc)/
abcbabc
** Failers
abcXabc
/(?1)[^]a()b](abc)/
abcXabc
** Failers
abcbabc
/(?2)[]a()b](abc)(xyz)/
xyzbabcxyz
/(?&N)[]a(?<N>)](?<M>abc)/
abc<abc
/(?&N)[]a(?<N>)](abc)/
abc<abc
/a[]b/
/a[^]b/
/a[]b/<J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P
Xa\P
Xaa\P
Xaaa\P
Xaaaa\P
/X[abc]{2,4}+b/
X\P
Xa\P
Xaa\P
Xaaa\P
Xaaaa\P
/X[^a]{2,4}b/
X\P
Xz\P
Xzz\P
Xzzz\P
Xzzzz\P
/X[^a]{2,4}?b/
X\P
Xz\P
Xzz\P
Xzzz\P
Xzzzz\P
/X[^a]{2,4}+b/
X\P
Xz\P
Xzz\P
Xzzz\P
Xzzzz\P
/(Y)X\1{2,4}b/
YX\P
YXY\P
YXYY\P
YXYYY\P
YXYYYY\P
/(Y)X\1{2,4}?b/
YX\P
YXY\P
YXYY\P
YXYYY\P
YXYYYY\P
/(Y)X\1{2,4}+b/
YX\P
YXY\P
YXYY\P
YXYYY\P
YXYYYY\P
/\++\KZ|\d+X|9+Y/
++++123999\P
++++123999Y\P
++++Z1234\P
/Z(*F)/
Z\P
ZA\P
/Z(?!)/
Z\P
ZA\P
/dog(sbody)?/
dogs\P
dogs\P\P
/dog(sbody)??/
dogs\P
dogs\P\P
/dog|dogsbody/
dogs\P
dogs\P\P
/dogsbody|dog/
dogs\P
dogs\P\P
/\bthe cat\b/
the cat\P
the cat\P\P
/abc/
abc\P
abc\P\P
/\w+A/P
CDAAAAB
/\w+A/PU
CDAAAAB
/abc\K123/
xyzabc123pqr
xyzabc12\P
xyzabc12\P\P
/(?<=abc)123/
xyzabc123pqr
xyzabc12\P
xyzabc12\P\P
/\babc\b/
+++abc+++
+++ab\P
+++ab\P\P
/(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
/(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
/(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
/abc\K/+
abcdef
abcdef\N\N
xyzabcdef\N\N
** Failers
abcdef\N
xyzabcdef\N
/^(?:(?=abc)|abc\K)/+
abcdef
abcdef\N\N
** Failers
abcdef\N
/a?b?/+
xyz
xyzabc
xyzabc\N
xyzabc\N\N
xyz\N\N
** Failers
xyz\N
/^a?b?/+
xyz
xyzabc
** Failers
xyzabc\N
xyzabc\N\N
xyz\N\N
xyz\N
/^(?<name>a|b\g<name>c)/
aaaa
bacxxx
bbaccxxx
bbbacccxx
/^(?<name>a|b\g'name'c)/
aaaa
bacxxx
bbaccxxx
bbbacccxx
/^(a|b\g<1>c)/
aaaa
bacxxx
bbaccxxx
bbbacccxx
/^(a|b\g'1'c)/
aaaa
bacxxx
bbaccxxx
bbbacccxx
/^(a|b\g'-1'c)/
aaaa
bacxxx
bbaccxxx
bbbacccxx
/(^(a|b\g<-1>c))/
aaaa
bacxxx
bbaccxxx
bbbacccxx
/(?-i:\g<name>)(?i:(?<name>a))/
XaaX
XAAX
/(?i:\g<name>)(?-i:(?<name>a))/
XaaX
** Failers
XAAX
/(?-i:\g<+1>)(?i:(a))/
XaaX
XAAX
/(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
/(?<n>a|b|c)\g<n>*/
abc
accccbbb
2009-04-11 18:57:41 +00:00
/^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
XYabcdY
2009-11-03 12:15:03 +00:00
/(?<=b(?1)|zzz)(a)/
xbaax
xzzzax
/(a)(?<=b\1)/
/(a)(?<=b+(?1))/
/(a+)(?<=b(?1))/
/(a(?<=b(?1)))/
/(?<=b(?1))xyz/
/(?<=b(?1))xyz(b+)pqrstuvew/
/(a|bc)\1/SI
/(a|bc)\1{2,3}/SI
/(a|bc)(?1)/SI
/(a|b\1)(a|b\1)/SI
/(a|b\1){2}/SI
/(a|bbbb\1)(a|bbbb\1)/SI
/(a|bbbb\1){2}/SI
/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/SI
/ (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* # optional leading comment
(?: (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) # initial word
(?: (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) )* # further okay, if led by a period
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* @ (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # initial subdomain
(?: #
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. # if led by a period...
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # ...further okay
)*
# address
| # or
(?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) # one word, optionally followed by....
(?:
[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
\(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) | # comments, or...
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
# quoted strings
)*
< (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* # leading <
(?: @ (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # initial subdomain
(?: #
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. # if led by a period...
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # ...further okay
)*
(?: (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* , (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* @ (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # initial subdomain
(?: #
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. # if led by a period...
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # ...further okay
)*
)* # further okay, if led by comma
: # closing colon
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* )? # optional route
(?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) # initial word
(?: (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) )* # further okay, if led by a period
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* @ (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # initial subdomain
(?: #
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. # if led by a period...
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # ...further okay
)*
# address spec
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* > # trailing >
# name and address
) (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* # optional trailing comment
/xSI
/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS
"(?>.*/)foo"SI
/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
/<a[\s]+href[\s]*=[\s]* # find <a href=
([\"\'])? # find single or double quote
(?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
# quote, otherwise match up to next space
/isxSI
/^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
: # followed by colon
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
/xiIS
/(?|(?<a>A)|(?<a>B))/I
AB\Ca
BA\Ca
/(?|(?<a>A)|(?<b>B))/
/(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
b(?<quote> (?<apostrophe>')|(?<realquote>")) )
(?('quote')[a-z]+|[0-9]+)/JIx
a"aaaaa
b"aaaaa
** Failers
b"11111
a"11111
/^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
abcdX
eX
** Failers
abcdY
ey
/(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/JDZx
abcdd
** Failers
abcdde
/abcd*/
xxxxabcd\P
xxxxabcd\P\P
/abcd*/i
xxxxabcd\P
xxxxabcd\P\P
XXXXABCD\P
XXXXABCD\P\P
/abc\d*/
xxxxabc1\P
xxxxabc1\P\P
/(a)bc\1*/
xxxxabca\P
xxxxabca\P\P
/abc[de]*/
xxxxabcde\P
xxxxabcde\P\P
2011-05-13 07:00:45 +00:00
/-- This is not in the Perl >= 5.10 test because Perl seems currently to be
broken and not behaving as specified in that it *does* bumpalong after
hitting (*COMMIT). --/
2009-11-03 12:15:03 +00:00
/(?1)(A(*COMMIT)|B)D/
ABD
XABD
BAD
ABXABD
** Failers
ABX
BAXBAD
2009-04-11 18:57:41 +00:00
2009-11-03 12:15:03 +00:00
/(\3)(\1)(a)/<JS>
cat
/(\3)(\1)(a)/SI<JS>
cat
/(\3)(\1)(a)/SI
cat
2009-04-11 18:57:41 +00:00
2010-01-21 17:49:38 +00:00
/i(?(DEFINE)(?<s>a))/SI
i
/()i(?(1)a)/SI
ia
/(?i)a(?-i)b|c/BZ
XabX
XAbX
CcC
** Failers
XABX
/(?i)a(?s)b|c/BZ
/(?i)a(?s-i)b|c/BZ
/^(ab(c\1)d|x){2}$/BZ
xabcxd
2010-03-29 11:58:06 +00:00
/^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
/^(?&t)*(?(DEFINE)(?<t>.))$/BZ
2011-05-13 07:00:45 +00:00
/ -- The first four of these are not in the Perl >= 5.10 test because Perl
2010-03-29 11:58:06 +00:00
documents that the use of \K in assertions is "not well defined". The
last is here because Perl gives the match as "b" rather than "ab". I
believe this to be a Perl bug. --/
/(?=a\Kb)ab/
ab
/(?!a\Kb)ac/
ac
/^abc(?<=b\Kc)d/
abcd
/^abc(?<!b\Kq)d/
abcd
/(?>a\Kb)z|(ab)/
ab
/----------------------/
/(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
2010-01-21 17:49:38 +00:00
2010-07-02 17:17:16 +00:00
/abc(*MARK:)pqr/
/abc(*:)pqr/
/abc(*FAIL:123)xyz/
/--- This should, and does, fail. In Perl, it does not, which I think is a
bug because replacing the B in the pattern by (B|D) does make it fail. ---/
/A(*COMMIT)B/+K
ACABX
/--- These should be different, but in Perl 5.11 are not, which I think
is a bug in Perl. ---/
/A(*THEN)B|A(*THEN)C/K
AC
/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)/K
C
D
/(*MARK:A)(*THEN:B)(C|X)/K
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. ---/
/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 ---/
/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. ---/
/(*COMMIT)ABC/
ABCDEFG
** 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
/^(ab (c+(*PRUNE)cd) | xyz)/x
abcccd
/^(ab (c+(*FAIL)cd) | xyz)/x
abcccd
/--- Perl 5.11 gets some of these wrong ---/
/(?>.(*ACCEPT))*?5/
abcde
/(.(*ACCEPT))*?5/
abcde
/(.(*ACCEPT))5/
abcde
/(.(*ACCEPT))*5/
abcde
/A\NB./BZ
2011-05-13 07:00:45 +00:00
ACBD
*** Failers
A\nB
ACB\n
2010-07-02 17:17:16 +00:00
/A\NB./sBZ
2011-05-13 07:00:45 +00:00
ACBD
ACB\n
*** Failers
A\nB
2010-07-02 17:17:16 +00:00
/A\NB/<crlf>
2011-05-13 07:00:45 +00:00
A\nB
A\rB
** Failers
A\r\nB
2010-07-02 17:17:16 +00:00
/\R+b/BZ
/\R+\n/BZ
/\R+\d/BZ
/\d*\R/BZ
/\s*\R/BZ
2011-05-13 07:00:45 +00:00
/-- Perl treats this one differently, not failing the second string. I believe
that is a bug in Perl. --/
/^((abc|abcx)(*THEN)y|abcd)/
abcd
*** Failers
abcxy
/(?<=abc)def/
abc\P\P
/abc$/
abc
abc\P
abc\P\P
/abc$/m
abc
abc\n
abc\P\P
abc\n\P\P
abc\P
abc\n\P
/abc\z/
abc
abc\P
abc\P\P
/abc\Z/
abc
abc\P
abc\P\P
/abc\b/
abc
abc\P
abc\P\P
/abc\B/
abc
abc\P
abc\P\P
/.+/
abc\>0
abc\>1
abc\>2
abc\>3
abc\>4
abc\>-4
/^\cģ/
/(?P<abn>(?P=abn)xxx)/BZ
/(a\1z)/BZ
/(?P<abn>(?P=abn)(?<badstufxxx)/BZ
/(?P<abn>(?P=axn)xxx)/BZ
/(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
2009-11-03 12:15:03 +00:00
/-- End of testinput2 --/