()ef def y $-[1] 1
()ef def y $+[1] 1
*a - c - Quantifier follows nothing
-(*)b - c - Quantifier follows nothing
+(|*)b - c - Quantifier follows nothing
+(*)b - c - Unknown verb
$b b n - -
a\ - c - Search pattern not terminated
a\(b a(b y $&-$1 a(b-
'ab|cd'i ABCD y $& AB
'()ef'i DEF y $&-$1 EF-
'*a'i - c - Quantifier follows nothing
-'(*)b'i - c - Quantifier follows nothing
+'(|*)b'i - c - Quantifier follows nothing
+'(*)b'i - c - Unknown verb
'$b'i B n - -
'a\'i - c - Search pattern not terminated
'a\(b'i A(B y $&-$1 A(B-
^(.)((??{"(.)(cz+)"})|.) abcd y $1-$2 a-b
^a(?>(??{q(b)}))(??{q(c)})d abcd y - -
^x(??{""})+$ x y $& x
+^(<(?:[^<>]+|(?3)|(?1))*>)()(!>!>!>)$ <<!>!>!>><>>!>!>!> y $1 <<!>!>!>><>>
+^(<(?:[^<>]+|(?1))*>)$ <<><<<><>>>> y $1 <<><<<><>>>>
+((?2)*)([fF]o+) fooFoFoo y $1-$2 fooFo-Foo
+(<(?:[^<>]+|(?R))*>) <<><<<><>>>> y $1 <<><<<><>>>>
+(?<n>foo|bar|baz) snofooewa y $1 foo
+(?<n>foo|bar|baz) snofooewa y $+{n} foo
+(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa y $+{n} foo
+(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa y $+{m} ew
+(?<n>foo)|(?<n>bar)|(?<n>baz) snofooewa y $+{n} foo
+(?<n>foo)(??{ $+{n} }) snofooefoofoowaa y $+{n} foo
+/(?'n'foo|bar|baz)/ snofooewa y $1 foo
+/(?'n'foo|bar|baz)/ snofooewa y $+{n} foo
+/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa y $+{n} foo
+/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa y $+{m} ew
+/(?'n'foo)|(?'n'bar)|(?<n>baz)/ snobazewa y $+{n} baz
+/(?'n'foo)(??{ $+{n} })/ snofooefoofoowaa y $+{n} foo
+/(?'n'foo)\k<n>/ ..foofoo.. y $1 foo
+/(?'n'foo)\k<n>/ ..foofoo.. y $+{n} foo
+/(?<n>foo)\k'n'/ ..foofoo.. y $1 foo
+/(?<n>foo)\k'n'/ ..foofoo.. y $+{n} foo
+/(?:(?<n>foo)|(?<n>bar))\k<n>/ ..barbar.. y $+{n} bar
+/^(?'main'<(?:[^<>]+|(?&crap)|(?&main))*>)(?'empty')(?'crap'!>!>!>)$/ <<!>!>!>><>>!>!>!> y $+{main} <<!>!>!>><>>
+/^(?'main'<(?:[^<>]+|(?&main))*>)$/ <<><<<><>>>> y $1 <<><<<><>>>>
+/(?'first'(?&second)*)(?'second'[fF]o+)/ fooFoFoo y $+{first}-$+{second} fooFo-Foo
+(?<A>foo)?(?(<A>)bar|nada) foobar y $+{A} foo
+(?<A>foo)?(?(<A>)bar|nada) foo-barnada y $& nada
+(?<A>foo)?(?(1)bar|nada) foo-barnada y $& nada
+(?<A>foo(?(R)bar))?(?1) foofoobar y $1 foo
+(?<A>foo(?(R)bar))?(?1) foofoobar y $& foofoobar
+(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $2 foo
+(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $& xfoofoobar
+(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $2 foo
+(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $& xfoofoobar
+(?1)(?(DEFINE)(blah)) blah y $& blah
+/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamimadam y $& madamimadam
+/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamiamadam n - -
+/(a)?((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
+/(a)*((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
+/(a)+((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
+/(a){1,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
+/(a){0,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
+/(ab)?((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
+/(ab)*((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
+/(ab)+((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
+/(ab){1,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
+/(ab){0,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
+# possessive captures
+a++a aaaaa n - -
+a*+a aaaaa n - -
+a{1,5}+a aaaaa n - -
+a?+a ab n - -
+a++b aaaaab y $& aaaaab
+a*+b aaaaab y $& aaaaab
+a{1,5}+b aaaaab y $& aaaaab
+a?+b ab y $& ab
+fooa++a fooaaaaa n - -
+fooa*+a fooaaaaa n - -
+fooa{1,5}+a fooaaaaa n - -
+fooa?+a fooab n - -
+fooa++b fooaaaaab y $& fooaaaaab
+fooa*+b fooaaaaab y $& fooaaaaab
+fooa{1,5}+b fooaaaaab y $& fooaaaaab
+fooa?+b fooab y $& fooab
+(?:aA)++(?:aA) aAaAaAaAaA n - aAaAaAaAaA
+(aA)++(aA) aAaAaAaAaA n - aAaAaAaAaA
+(aA|bB)++(aA|bB) aAaAbBaAbB n - aAaAbBaAbB
+(?:aA|bB)++(?:aA|bB) aAbBbBbBaA n - aAbBbBbBaA
+(?:aA)*+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
+(aA)*+(aA) aAaAaAaAaA n - aAaAaAaAaA
+(aA|bB)*+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
+(?:aA|bB)*+(?:aA|bB) aAaAaAbBaA n - aAaAaAbBaA
+(?:aA){1,5}+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
+(aA){1,5}+(aA) aAaAaAaAaA n - aAaAaAaAaA
+(aA|bB){1,5}+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
+(?:aA|bB){1,5}+(?:aA|bB) bBbBbBbBbB n - bBbBbBbBbB
+(?:aA)?+(?:aA) aAb n - aAb
+(aA)?+(aA) aAb n - aAb
+(aA|bB)?+(aA|bB) bBb n - bBb
+(?:aA|bB)?+(?:aA|bB) aAb n - aAb
+(?:aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
+(aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
+(aA|bB)++b aAbBaAaAbBb y $& aAbBaAaAbBb
+(?:aA|bB)++b aAbBbBaAaAb y $& aAbBbBaAaAb
+(?:aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
+(aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
+(aA|bB)*+b bBbBbBbBbBb y $& bBbBbBbBbBb
+(?:aA|bB)*+b bBaAbBbBaAb y $& bBaAbBbBaAb
+(?:aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
+(aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
+(aA|bB){1,5}+b bBaAbBaAbBb y $& bBaAbBaAbBb
+(?:aA|bB){1,5}+b aAbBaAbBbBb y $& aAbBaAbBbBb
+(?:aA)?+b aAb y $& aAb
+(aA)?+b aAb y $& aAb
+(aA|bB)?+b bBb y $& bBb
+(?:aA|bB)?+b bBb y $& bBb
+foo(?:aA)++(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
+foo(aA)++(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
+foo(aA|bB)++(aA|bB) foobBbBbBaAaA n - foobBbBbBaAaA
+foo(?:aA|bB)++(?:aA|bB) fooaAaAaAaAaA n - fooaAaAaAaAaA
+foo(?:aA)*+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
+foo(aA)*+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
+foo(aA|bB)*+(aA|bB) foobBaAbBaAaA n - foobBaAbBaAaA
+foo(?:aA|bB)*+(?:aA|bB) fooaAaAbBbBaA n - fooaAaAbBbBaA
+foo(?:aA){1,5}+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
+foo(aA){1,5}+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
+foo(aA|bB){1,5}+(aA|bB) fooaAbBbBaAaA n - fooaAbBbBaAaA
+foo(?:aA|bB){1,5}+(?:aA|bB) fooaAbBbBaAbB n - fooaAbBbBaAbB
+foo(?:aA)?+(?:aA) fooaAb n - fooaAb
+foo(aA)?+(aA) fooaAb n - fooaAb
+foo(aA|bB)?+(aA|bB) foobBb n - foobBb
+foo(?:aA|bB)?+(?:aA|bB) fooaAb n - fooaAb
+foo(?:aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
+foo(aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
+foo(aA|bB)++b foobBaAbBaAbBb y $& foobBaAbBaAbBb
+foo(?:aA|bB)++b fooaAaAbBaAaAb y $& fooaAaAbBaAaAb
+foo(?:aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
+foo(aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
+foo(aA|bB)*+b foobBbBaAaAaAb y $& foobBbBaAaAaAb
+foo(?:aA|bB)*+b foobBaAaAbBaAb y $& foobBaAaAbBaAb
+foo(?:aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
+foo(aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
+foo(aA|bB){1,5}+b foobBaAaAaAaAb y $& foobBaAaAaAaAb
+foo(?:aA|bB){1,5}+b fooaAbBaAbBbBb y $& fooaAbBaAbBbBb
+foo(?:aA)?+b fooaAb y $& fooaAb
+foo(aA)?+b fooaAb y $& fooaAb
+foo(aA|bB)?+b foobBb y $& foobBb
+foo(?:aA|bB)?+b foobBb y $& foobBb
+
+([^()]++|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
+round\(([^()]++)\) _I(round(xs * sz),1) y $1 xs * sz
+
+(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $1 baz3
+(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $& foo1bar2baz3y
+(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $1 baz3
+(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $& foo1bar2baz3y
+
+([yX].|WORDS|[yX].|WORD)S WORDS y $1 WORD
+(WORDS|WORLD|WORD)S WORDS y $1 WORD
+([yX].|WORDS|WORD|[xY].)S WORDS y $1 WORD
+(foo|fool|[zx].|money|parted)$ fool y $1 fool
+([zx].|foo|fool|[zq].|money|parted|[yx].)$ fool y $1 fool
+(foo|fool|[zx].|money|parted)$ fools n - -
+([zx].|foo|fool|[qx].|money|parted|[py].)$ fools n - -
+
+([yX].|WORDS|[yX].|WORD)+S WORDS y $1 WORD
+(WORDS|WORLD|WORD)+S WORDS y $1 WORD
+([yX].|WORDS|WORD|[xY].)+S WORDS y $1 WORD
+(foo|fool|[zx].|money|parted)+$ fool y $1 fool
+([zx].|foo|fool|[zq].|money|parted|[yx].)+$ fool y $1 fool
+(foo|fool|[zx].|money|parted)+$ fools n - -
+([zx].|foo|fool|[qx].|money|parted|[py].)+$ fools n - -
+
+(x|y|z[QW])+(longish|loquatious|excessive|overblown[QW])+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
+(x|y|z[QW])*(longish|loquatious|excessive|overblown[QW])* xyzQzWlongishoverblownW y $1-$2 zW-overblownW
+(x|y|z[QW]){1,5}(longish|loquatious|excessive|overblown[QW]){1,5} xyzQzWlongishoverblownW y $1-$2 zW-overblownW
+
+(x|y|z[QW])++(longish|loquatious|excessive|overblown[QW])++ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
+(x|y|z[QW])*+(longish|loquatious|excessive|overblown[QW])*+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
+(x|y|z[QW]){1,5}+(longish|loquatious|excessive|overblown[QW]){1,5}+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
+
+
+a*(?!) aaaab n - -
+a*(*FAIL) aaaab n - -
+a*(*F) aaaab n - -
+
+(A(A|B(*ACCEPT)|C)D)(E) AB y $1 AB
+(A(A|B(*ACCEPT)|C)D)(E) ACDE y $1$2$3 ACDCE
+
+(a)(?:(?-1)|(?+1))(b) aab y $&-$1-$2 aab-a-b
+(a)(?:(?-1)|(?+1))(b) abb y $1-$2 a-b
+(a)(?:(?-1)|(?+1))(b) acb n - -
+
+(foo)(\R1) foofoo y $1-$2 foo-foo
+(foo)(\R1)(foo)(\R1) foofoofoofoo y $1-$2-$3-$4 foo-foo-foo-foo