This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Variants of several regression tests that run the actul tests inside
[perl5.git] / t / op / re_tests
CommitLineData
5a51db05
NC
1# This stops me getting screenfulls of syntax errors every time I accidentally
2# run this file via a shell glob
3__END__
378cc40b 4abc abc y $& abc
301f462a
MJD
5abc abc y $-[0] 0
6abc abc y $+[0] 3
378cc40b
LW
7abc xbc n - -
8abc axc n - -
9abc abx n - -
10abc xabcy y $& abc
301f462a
MJD
11abc xabcy y $-[0] 1
12abc xabcy y $+[0] 4
378cc40b 13abc ababc y $& abc
301f462a
MJD
14abc ababc y $-[0] 2
15abc ababc y $+[0] 5
378cc40b 16ab*c abc y $& abc
301f462a
MJD
17ab*c abc y $-[0] 0
18ab*c abc y $+[0] 3
378cc40b 19ab*bc abc y $& abc
301f462a
MJD
20ab*bc abc y $-[0] 0
21ab*bc abc y $+[0] 3
378cc40b 22ab*bc abbc y $& abbc
301f462a
MJD
23ab*bc abbc y $-[0] 0
24ab*bc abbc y $+[0] 4
378cc40b 25ab*bc abbbbc y $& abbbbc
301f462a
MJD
26ab*bc abbbbc y $-[0] 0
27ab*bc abbbbc y $+[0] 6
c277df42 28.{1} abbbbc y $& a
301f462a
MJD
29.{1} abbbbc y $-[0] 0
30.{1} abbbbc y $+[0] 1
c277df42 31.{3,4} abbbbc y $& abbb
301f462a
MJD
32.{3,4} abbbbc y $-[0] 0
33.{3,4} abbbbc y $+[0] 4
a687059c 34ab{0,}bc abbbbc y $& abbbbc
301f462a
MJD
35ab{0,}bc abbbbc y $-[0] 0
36ab{0,}bc abbbbc y $+[0] 6
378cc40b 37ab+bc abbc y $& abbc
301f462a
MJD
38ab+bc abbc y $-[0] 0
39ab+bc abbc y $+[0] 4
378cc40b
LW
40ab+bc abc n - -
41ab+bc abq n - -
a687059c 42ab{1,}bc abq n - -
378cc40b 43ab+bc abbbbc y $& abbbbc
301f462a
MJD
44ab+bc abbbbc y $-[0] 0
45ab+bc abbbbc y $+[0] 6
a687059c 46ab{1,}bc abbbbc y $& abbbbc
301f462a
MJD
47ab{1,}bc abbbbc y $-[0] 0
48ab{1,}bc abbbbc y $+[0] 6
a687059c 49ab{1,3}bc abbbbc y $& abbbbc
301f462a
MJD
50ab{1,3}bc abbbbc y $-[0] 0
51ab{1,3}bc abbbbc y $+[0] 6
a687059c 52ab{3,4}bc abbbbc y $& abbbbc
301f462a
MJD
53ab{3,4}bc abbbbc y $-[0] 0
54ab{3,4}bc abbbbc y $+[0] 6
a687059c 55ab{4,5}bc abbbbc n - -
378cc40b
LW
56ab?bc abbc y $& abbc
57ab?bc abc y $& abc
a687059c 58ab{0,1}bc abc y $& abc
378cc40b
LW
59ab?bc abbbbc n - -
60ab?c abc y $& abc
a687059c 61ab{0,1}c abc y $& abc
378cc40b
LW
62^abc$ abc y $& abc
63^abc$ abcc n - -
64^abc abcc y $& abc
65^abc$ aabc n - -
66abc$ aabc y $& abc
c277df42 67abc$ aabcd n - -
378cc40b
LW
68^ abc y $&
69$ abc y $&
70a.c abc y $& abc
71a.c axc y $& axc
72a.*c axyzc y $& axyzc
73a.*c axyzd n - -
74a[bc]d abc n - -
75a[bc]d abd y $& abd
3b968408
YO
76a[b]d abd y $& abd
77[a][b][d] abd y $& abd
78.[b]. abd y $& abd
79.[b]. aBd n - -
80(?i:.[b].) abd y $& abd
378cc40b
LW
81a[b-d]e abd n - -
82a[b-d]e ace y $& ace
83a[b-d] aac y $& ac
84a[-b] a- y $& a-
85a[b-] a- y $& a-
b2a156bd 86a[b-a] - c - Invalid [] range \"b-a\"
24b61696
RK
87a[]b - c - Unmatched [
88a[ - c - Unmatched [
378cc40b
LW
89a] a] y $& a]
90a[]]b a]b y $& a]b
91a[^bc]d aed y $& aed
92a[^bc]d abd n - -
93a[^-b]c adc y $& adc
94a[^-b]c a-c n - -
95a[^]b]c a]c n - -
96a[^]b]c adc y $& adc
bbce6d69
PP
97\ba\b a- y - -
98\ba\b -a y - -
99\ba\b -a- y - -
100\by\b xy n - -
101\by\b yz n - -
102\by\b xyz n - -
103\Ba\B a- n - -
104\Ba\B -a n - -
105\Ba\B -a- n - -
106\By\b xy y - -
301f462a
MJD
107\By\b xy y $-[0] 1
108\By\b xy y $+[0] 2
109\By\b xy y - -
bbce6d69
PP
110\by\B yz y - -
111\By\B xyz y - -
112\w a y - -
113\w - n - -
114\W a n - -
115\W - y - -
116a\sb a b y - -
117a\sb a-b n - -
118a\Sb a b n - -
119a\Sb a-b y - -
120\d 1 y - -
121\d - n - -
122\D 1 n - -
123\D - y - -
124[\w] a y - -
125[\w] - n - -
126[\W] a n - -
127[\W] - y - -
128a[\s]b a b y - -
129a[\s]b a-b n - -
130a[\S]b a b n - -
131a[\S]b a-b y - -
132[\d] 1 y - -
133[\d] - n - -
134[\D] 1 n - -
135[\D] - y - -
378cc40b
LW
136ab|cd abc y $& ab
137ab|cd abcd y $& ab
138()ef def y $&-$1 ef-
301f462a
MJD
139()ef def y $-[0] 1
140()ef def y $+[0] 3
141()ef def y $-[1] 1
142()ef def y $+[1] 1
24b61696 143*a - c - Quantifier follows nothing
e2e6a0f1
YO
144(|*)b - c - Quantifier follows nothing
145(*)b - c - Unknown verb
378cc40b 146$b b n - -
1b1626e4 147a\ - c - Search pattern not terminated
378cc40b
LW
148a\(b a(b y $&-$1 a(b-
149a\(*b ab y $& ab
150a\(*b a((b y $& a((b
b2a156bd 151a\\b a\\b y $& a\\b
24b61696
RK
152abc) - c - Unmatched )
153(abc - c - Unmatched (
378cc40b 154((a)) abc y $&-$1-$2 a-a-a
301f462a
MJD
155((a)) abc y $-[0]-$-[1]-$-[2] 0-0-0
156((a)) abc y $+[0]-$+[1]-$+[2] 1-1-1
157((a)) abc b @- 0 0 0
158((a)) abc b @+ 1 1 1
378cc40b 159(a)b(c) abc y $&-$1-$2 abc-a-c
301f462a
MJD
160(a)b(c) abc y $-[0]-$-[1]-$-[2] 0-0-2
161(a)b(c) abc y $+[0]-$+[1]-$+[2] 3-1-3
378cc40b 162a+b+c aabbabc y $& abc
a687059c 163a{1,}b{1,}c aabbabc y $& abc
24b61696 164a** - c - Nested quantifiers
a0d0e21e 165a.+?c abcabc y $& abc
378cc40b 166(a+|b)* ab y $&-$1 ab-b
301f462a
MJD
167(a+|b)* ab y $-[0] 0
168(a+|b)* ab y $+[0] 2
169(a+|b)* ab y $-[1] 1
170(a+|b)* ab y $+[1] 2
a687059c 171(a+|b){0,} ab y $&-$1 ab-b
378cc40b 172(a+|b)+ ab y $&-$1 ab-b
a687059c 173(a+|b){1,} ab y $&-$1 ab-b
378cc40b 174(a+|b)? ab y $&-$1 a-a
a687059c 175(a+|b){0,1} ab y $&-$1 a-a
24b61696 176)( - c - Unmatched )
378cc40b
LW
177[^ab]* cde y $& cde
178abc n - -
179a* y $&
180([abc])*d abbbcd y $&-$1 abbbcd-c
181([abc])*bcd abcd y $&-$1 abcd-a
182a|b|c|d|e e y $& e
183(a|b|c|d|e)f ef y $&-$1 ef-e
301f462a
MJD
184(a|b|c|d|e)f ef y $-[0] 0
185(a|b|c|d|e)f ef y $+[0] 2
186(a|b|c|d|e)f ef y $-[1] 0
187(a|b|c|d|e)f ef y $+[1] 1
378cc40b
LW
188abcd*efg abcdefg y $& abcdefg
189ab* xabyabbbz y $& ab
190ab* xayabbbz y $& a
191(ab|cd)e abcde y $&-$1 cde-cd
192[abhgefdc]ij hij y $& hij
193^(ab|cd)e abcde n x$1y xy
194(abc|)ef abcdef y $&-$1 ef-
195(a|b)c*d abcd y $&-$1 bcd-b
196(ab|ab*)bc abc y $&-$1 abc-a
197a([bc]*)c* abc y $&-$1 abc-bc
198a([bc]*)(c*d) abcd y $&-$1-$2 abcd-bc-d
301f462a
MJD
199a([bc]*)(c*d) abcd y $-[0] 0
200a([bc]*)(c*d) abcd y $+[0] 4
201a([bc]*)(c*d) abcd y $-[1] 1
202a([bc]*)(c*d) abcd y $+[1] 3
203a([bc]*)(c*d) abcd y $-[2] 3
204a([bc]*)(c*d) abcd y $+[2] 4
378cc40b
LW
205a([bc]+)(c*d) abcd y $&-$1-$2 abcd-bc-d
206a([bc]*)(c+d) abcd y $&-$1-$2 abcd-b-cd
301f462a
MJD
207a([bc]*)(c+d) abcd y $-[0] 0
208a([bc]*)(c+d) abcd y $+[0] 4
209a([bc]*)(c+d) abcd y $-[1] 1
210a([bc]*)(c+d) abcd y $+[1] 2
211a([bc]*)(c+d) abcd y $-[2] 2
212a([bc]*)(c+d) abcd y $+[2] 4
378cc40b
LW
213a[bcd]*dcdcde adcdcde y $& adcdcde
214a[bcd]+dcdcde adcdcde n - -
215(ab|a)b*c abc y $&-$1 abc-ab
301f462a
MJD
216(ab|a)b*c abc y $-[0] 0
217(ab|a)b*c abc y $+[0] 3
218(ab|a)b*c abc y $-[1] 0
219(ab|a)b*c abc y $+[1] 2
378cc40b 220((a)(b)c)(d) abcd y $1-$2-$3-$4 abc-a-b-d
301f462a
MJD
221((a)(b)c)(d) abcd y $-[0] 0
222((a)(b)c)(d) abcd y $+[0] 4
223((a)(b)c)(d) abcd y $-[1] 0
224((a)(b)c)(d) abcd y $+[1] 3
225((a)(b)c)(d) abcd y $-[2] 0
226((a)(b)c)(d) abcd y $+[2] 1
227((a)(b)c)(d) abcd y $-[3] 1
228((a)(b)c)(d) abcd y $+[3] 2
229((a)(b)c)(d) abcd y $-[4] 3
230((a)(b)c)(d) abcd y $+[4] 4
378cc40b
LW
231[a-zA-Z_][a-zA-Z0-9_]* alpha y $& alpha
232^a(bc+|b[eh])g|.h$ abh y $&-$1 bh-
233(bc+d$|ef*g.|h?i(j|k)) effgz y $&-$1-$2 effgz-effgz-
234(bc+d$|ef*g.|h?i(j|k)) ij y $&-$1-$2 ij-ij-j
235(bc+d$|ef*g.|h?i(j|k)) effg n - -
236(bc+d$|ef*g.|h?i(j|k)) bcdd n - -
237(bc+d$|ef*g.|h?i(j|k)) reffgz y $&-$1-$2 effgz-effgz-
fe14fcc3 238((((((((((a)))))))))) a y $10 a
301f462a
MJD
239((((((((((a)))))))))) a y $-[0] 0
240((((((((((a)))))))))) a y $+[0] 1
241((((((((((a)))))))))) a y $-[10] 0
242((((((((((a)))))))))) a y $+[10] 1
fe14fcc3 243((((((((((a))))))))))\10 aa y $& aa
9d116dd7
JH
244((((((((((a))))))))))${bang} aa n - -
245((((((((((a))))))))))${bang} a! y $& a!
378cc40b
LW
246(((((((((a))))))))) a y $& a
247multiple words of text uh-uh n - -
248multiple words multiple words, yeah y $& multiple words
249(.*)c(.*) abcde y $&-$1-$2 abcde-ab-de
250\((.*), (.*)\) (a, b) y ($2, $1) (b, a)
251[k] ab n - -
b2a156bd
DM
252abcd abcd y $&-\$&-\\$& abcd-\$&-\\abcd
253a(bc)d abcd y $1-\$1-\\$1 bc-\$1-\\bc
378cc40b
LW
254a[-]?c ac y $& ac
255(abc)\1 abcabc y $1 abc
256([a-c]*)\1 abcabc y $1 abc
9baa0206
HS
257\1 - c - Reference to nonexistent group
258\2 - c - Reference to nonexistent group
88307081
RGS
259\g1 - c - Reference to nonexistent group
260\g-1 - c - Reference to nonexistent or unclosed group
261\g{1} - c - Reference to nonexistent group
262\g{-1} - c - Reference to nonexistent or unclosed group
263\g0 - c - Reference to invalid group 0
264\g-0 - c - Reference to invalid group 0
265\g{0} - c - Reference to invalid group 0
266\g{-0} - c - Reference to invalid group 0
ef64f398
HS
267(a)|\1 a y - -
268(a)|\1 x n - -
9baa0206 269(a)|\2 - c - Reference to nonexistent group
ef64f398
HS
270(([a-c])b*?\2)* ababbbcbc y $&-$1-$2 ababb-bb-b
271(([a-c])b*?\2){3} ababbbcbc y $&-$1-$2 ababbbcbc-cbc-c
272((\3|b)\2(a)x)+ aaxabxbaxbbx n - -
273((\3|b)\2(a)x)+ aaaxabaxbaaxbbax y $&-$1-$2-$3 bbax-bbax-b-a
274((\3|b)\2(a)){2,} bbaababbabaaaaabbaaaabba y $&-$1-$2-$3 bbaaaabba-bba-b-a
ee1d8f2a
RU
275#Bug #3589 - up to perl-5.6.0 matches incorrectly, from 5.6.1 not anymore
276^((.)?a\2)+$ babadad n - -
301f462a
MJD
277(a)|(b) b y $-[0] 0
278(a)|(b) b y $+[0] 1
279(a)|(b) b y x$-[1] x
280(a)|(b) b y x$+[1] x
281(a)|(b) b y $-[2] 0
282(a)|(b) b y $+[2] 1
1462b684
LW
283'abc'i ABC y $& ABC
284'abc'i XBC n - -
285'abc'i AXC n - -
286'abc'i ABX n - -
287'abc'i XABCY y $& ABC
288'abc'i ABABC y $& ABC
289'ab*c'i ABC y $& ABC
290'ab*bc'i ABC y $& ABC
291'ab*bc'i ABBC y $& ABBC
a0d0e21e
LW
292'ab*?bc'i ABBBBC y $& ABBBBC
293'ab{0,}?bc'i ABBBBC y $& ABBBBC
294'ab+?bc'i ABBC y $& ABBC
1462b684
LW
295'ab+bc'i ABC n - -
296'ab+bc'i ABQ n - -
297'ab{1,}bc'i ABQ n - -
298'ab+bc'i ABBBBC y $& ABBBBC
a0d0e21e
LW
299'ab{1,}?bc'i ABBBBC y $& ABBBBC
300'ab{1,3}?bc'i ABBBBC y $& ABBBBC
301'ab{3,4}?bc'i ABBBBC y $& ABBBBC
302'ab{4,5}?bc'i ABBBBC n - -
303'ab??bc'i ABBC y $& ABBC
304'ab??bc'i ABC y $& ABC
305'ab{0,1}?bc'i ABC y $& ABC
306'ab??bc'i ABBBBC n - -
307'ab??c'i ABC y $& ABC
308'ab{0,1}?c'i ABC y $& ABC
1462b684
LW
309'^abc$'i ABC y $& ABC
310'^abc$'i ABCC n - -
311'^abc'i ABCC y $& ABC
312'^abc$'i AABC n - -
313'abc$'i AABC y $& ABC
314'^'i ABC y $&
315'$'i ABC y $&
316'a.c'i ABC y $& ABC
317'a.c'i AXC y $& AXC
a0d0e21e 318'a.*?c'i AXYZC y $& AXYZC
1462b684
LW
319'a.*c'i AXYZD n - -
320'a[bc]d'i ABC n - -
321'a[bc]d'i ABD y $& ABD
322'a[b-d]e'i ABD n - -
323'a[b-d]e'i ACE y $& ACE
324'a[b-d]'i AAC y $& AC
325'a[-b]'i A- y $& A-
326'a[b-]'i A- y $& A-
b2a156bd 327'a[b-a]'i - c - Invalid [] range \"b-a\"
24b61696
RK
328'a[]b'i - c - Unmatched [
329'a['i - c - Unmatched [
1462b684
LW
330'a]'i A] y $& A]
331'a[]]b'i A]B y $& A]B
332'a[^bc]d'i AED y $& AED
333'a[^bc]d'i ABD n - -
334'a[^-b]c'i ADC y $& ADC
335'a[^-b]c'i A-C n - -
336'a[^]b]c'i A]C n - -
337'a[^]b]c'i ADC y $& ADC
338'ab|cd'i ABC y $& AB
339'ab|cd'i ABCD y $& AB
340'()ef'i DEF y $&-$1 EF-
24b61696 341'*a'i - c - Quantifier follows nothing
e2e6a0f1
YO
342'(|*)b'i - c - Quantifier follows nothing
343'(*)b'i - c - Unknown verb
1462b684 344'$b'i B n - -
1b1626e4 345'a\'i - c - Search pattern not terminated
1462b684
LW
346'a\(b'i A(B y $&-$1 A(B-
347'a\(*b'i AB y $& AB
348'a\(*b'i A((B y $& A((B
b2a156bd 349'a\\b'i A\\B y $& A\\B
24b61696
RK
350'abc)'i - c - Unmatched )
351'(abc'i - c - Unmatched (
1462b684
LW
352'((a))'i ABC y $&-$1-$2 A-A-A
353'(a)b(c)'i ABC y $&-$1-$2 ABC-A-C
354'a+b+c'i AABBABC y $& ABC
355'a{1,}b{1,}c'i AABBABC y $& ABC
24b61696 356'a**'i - c - Nested quantifiers
a0d0e21e
LW
357'a.+?c'i ABCABC y $& ABC
358'a.*?c'i ABCABC y $& ABC
359'a.{0,5}?c'i ABCABC y $& ABC
1462b684
LW
360'(a+|b)*'i AB y $&-$1 AB-B
361'(a+|b){0,}'i AB y $&-$1 AB-B
362'(a+|b)+'i AB y $&-$1 AB-B
363'(a+|b){1,}'i AB y $&-$1 AB-B
364'(a+|b)?'i AB y $&-$1 A-A
365'(a+|b){0,1}'i AB y $&-$1 A-A
a0d0e21e 366'(a+|b){0,1}?'i AB y $&-$1 -
24b61696 367')('i - c - Unmatched )
1462b684
LW
368'[^ab]*'i CDE y $& CDE
369'abc'i n - -
370'a*'i y $&
371'([abc])*d'i ABBBCD y $&-$1 ABBBCD-C
372'([abc])*bcd'i ABCD y $&-$1 ABCD-A
373'a|b|c|d|e'i E y $& E
374'(a|b|c|d|e)f'i EF y $&-$1 EF-E
1462b684
LW
375'abcd*efg'i ABCDEFG y $& ABCDEFG
376'ab*'i XABYABBBZ y $& AB
377'ab*'i XAYABBBZ y $& A
378'(ab|cd)e'i ABCDE y $&-$1 CDE-CD
379'[abhgefdc]ij'i HIJ y $& HIJ
380'^(ab|cd)e'i ABCDE n x$1y XY
381'(abc|)ef'i ABCDEF y $&-$1 EF-
382'(a|b)c*d'i ABCD y $&-$1 BCD-B
383'(ab|ab*)bc'i ABC y $&-$1 ABC-A
384'a([bc]*)c*'i ABC y $&-$1 ABC-BC
385'a([bc]*)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
386'a([bc]+)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
387'a([bc]*)(c+d)'i ABCD y $&-$1-$2 ABCD-B-CD
388'a[bcd]*dcdcde'i ADCDCDE y $& ADCDCDE
389'a[bcd]+dcdcde'i ADCDCDE n - -
390'(ab|a)b*c'i ABC y $&-$1 ABC-AB
391'((a)(b)c)(d)'i ABCD y $1-$2-$3-$4 ABC-A-B-D
392'[a-zA-Z_][a-zA-Z0-9_]*'i ALPHA y $& ALPHA
393'^a(bc+|b[eh])g|.h$'i ABH y $&-$1 BH-
394'(bc+d$|ef*g.|h?i(j|k))'i EFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
395'(bc+d$|ef*g.|h?i(j|k))'i IJ y $&-$1-$2 IJ-IJ-J
396'(bc+d$|ef*g.|h?i(j|k))'i EFFG n - -
397'(bc+d$|ef*g.|h?i(j|k))'i BCDD n - -
398'(bc+d$|ef*g.|h?i(j|k))'i REFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
399'((((((((((a))))))))))'i A y $10 A
400'((((((((((a))))))))))\10'i AA y $& AA
9d116dd7
JH
401'((((((((((a))))))))))${bang}'i AA n - -
402'((((((((((a))))))))))${bang}'i A! y $& A!
1462b684 403'(((((((((a)))))))))'i A y $& A
a0d0e21e
LW
404'(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))'i A y $1 A
405'(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))'i C y $1 C
1462b684
LW
406'multiple words of text'i UH-UH n - -
407'multiple words'i MULTIPLE WORDS, YEAH y $& MULTIPLE WORDS
408'(.*)c(.*)'i ABCDE y $&-$1-$2 ABCDE-AB-DE
409'\((.*), (.*)\)'i (A, B) y ($2, $1) (B, A)
410'[k]'i AB n - -
b2a156bd
DM
411'abcd'i ABCD y $&-\$&-\\$& ABCD-\$&-\\ABCD
412'a(bc)d'i ABCD y $1-\$1-\\$1 BC-\$1-\\BC
1462b684
LW
413'a[-]?c'i AC y $& AC
414'(abc)\1'i ABCABC y $1 ABC
415'([a-c]*)\1'i ABCABC y $1 ABC
a0d0e21e
LW
416a(?!b). abad y $& ad
417a(?=d). abad y $& ad
418a(?=c|d). abad y $& ad
419a(?:b|c|d)(.) ace y $1 e
420a(?:b|c|d)*(.) ace y $1 e
421a(?:b|c|d)+?(.) ace y $1 e
c277df42
IZ
422a(?:b|c|d)+?(.) acdbcdbe y $1 d
423a(?:b|c|d)+(.) acdbcdbe y $1 e
424a(?:b|c|d){2}(.) acdbcdbe y $1 b
425a(?:b|c|d){4,5}(.) acdbcdbe y $1 b
426a(?:b|c|d){4,5}?(.) acdbcdbe y $1 d
427((foo)|(bar))* foobar y $1-$2-$3 bar-foo-bar
9baa0206 428:(?: - c - Sequence (? incomplete
c277df42
IZ
429a(?:b|c|d){6,7}(.) acdbcdbe y $1 e
430a(?:b|c|d){6,7}?(.) acdbcdbe y $1 e
431a(?:b|c|d){5,6}(.) acdbcdbe y $1 e
432a(?:b|c|d){5,6}?(.) acdbcdbe y $1 b
433a(?:b|c|d){5,7}(.) acdbcdbe y $1 e
434a(?:b|c|d){5,7}?(.) acdbcdbe y $1 b
a0d0e21e
LW
435a(?:b|(c|e){1,2}?|d)+?(.) ace y $1$2 ce
436^(.+)?B AB y $1 A
c277df42
IZ
437^([^a-z])|(\^)$ . y $1 .
438^[<>]& <&OUT y $& <&
439^(a\1?){4}$ aaaaaaaaaa y $1 aaaa
440^(a\1?){4}$ aaaaaaaaa n - -
441^(a\1?){4}$ aaaaaaaaaaa n - -
af3f8c16
IZ
442^(a(?(1)\1)){4}$ aaaaaaaaaa y $1 aaaa
443^(a(?(1)\1)){4}$ aaaaaaaaa n - -
444^(a(?(1)\1)){4}$ aaaaaaaaaaa n - -
708e3b05
IZ
445((a{4})+) aaaaaaaaa y $1 aaaaaaaa
446(((aa){2})+) aaaaaaaaaa y $1 aaaaaaaa
447(((a{2}){2})+) aaaaaaaaaa y $1 aaaaaaaa
c277df42
IZ
448(?:(f)(o)(o)|(b)(a)(r))* foobar y $1:$2:$3:$4:$5:$6 f:o:o:b:a:r
449(?<=a)b ab y $& b
450(?<=a)b cb n - -
451(?<=a)b b n - -
452(?<!c)b ab y $& b
453(?<!c)b cb n - -
454(?<!c)b b y - -
455(?<!c)b b y $& b
24b61696 456(?<%)b - c - Sequence (?<%...) not recognized
c277df42
IZ
457(?:..)*a aba y $& aba
458(?:..)*?a aba y $& a
459^(?:b|a(?=(.)))*\1 abc y $& ab
460^(){3,5} abc y a$1 a
461^(a+)*ax aax y $1 a
462^((a|b)+)*ax aax y $1 a
463^((a|bc)+)*ax aax y $1 a
464(a|x)*ab cab y y$1 y
465(a)*ab cab y y$1 y
466(?:(?i)a)b ab y $& ab
467((?i)a)b ab y $&:$1 ab:a
468(?:(?i)a)b Ab y $& Ab
469((?i)a)b Ab y $&:$1 Ab:A
470(?:(?i)a)b aB n - -
471((?i)a)b aB n - -
ca9dfc88
IZ
472(?i:a)b ab y $& ab
473((?i:a))b ab y $&:$1 ab:a
474(?i:a)b Ab y $& Ab
475((?i:a))b Ab y $&:$1 Ab:A
476(?i:a)b aB n - -
477((?i:a))b aB n - -
478'(?:(?-i)a)b'i ab y $& ab
479'((?-i)a)b'i ab y $&:$1 ab:a
480'(?:(?-i)a)b'i aB y $& aB
481'((?-i)a)b'i aB y $&:$1 aB:a
482'(?:(?-i)a)b'i Ab n - -
483'((?-i)a)b'i Ab n - -
484'(?:(?-i)a)b'i aB y $& aB
485'((?-i)a)b'i aB y $1 a
486'(?:(?-i)a)b'i AB n - -
487'((?-i)a)b'i AB n - -
488'(?-i:a)b'i ab y $& ab
489'((?-i:a))b'i ab y $&:$1 ab:a
490'(?-i:a)b'i aB y $& aB
491'((?-i:a))b'i aB y $&:$1 aB:a
492'(?-i:a)b'i Ab n - -
493'((?-i:a))b'i Ab n - -
494'(?-i:a)b'i aB y $& aB
495'((?-i:a))b'i aB y $1 a
496'(?-i:a)b'i AB n - -
497'((?-i:a))b'i AB n - -
498'((?-i:a.))b'i a\nB n - -
499'((?s-i:a.))b'i a\nB y $1 a\n
500'((?s-i:a.))b'i B\nB n - -
c277df42
IZ
501(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b))) cabbbb y $& cabbbb
502(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb))) caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb y $& caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
503'(ab)\d\1'i Ab4ab y $1 Ab
504'(ab)\d\1'i ab4Ab y $1 ab
ad4f75a6 505foo\w*\d{4}baz foobar1234baz y $& foobar1234baz
e3faa678 506a(?{})b cabd yt $& ab threads confuse eval
24b61696
RK
507a(?{)b - c - Sequence (?{...}) not terminated or not {}-balanced
508a(?{{})b - c - Sequence (?{...}) not terminated or not {}-balanced
380a0633 509a(?{}})b - c -
24b61696 510a(?{"{"})b - c - Sequence (?{...}) not terminated or not {}-balanced
e3faa678 511a(?{"\{"})b cabd yt $& ab threads confuse eval
d98d5fff 512a(?{"{"}})b - c - Unmatched right curly bracket
e3faa678 513a(?{$::bl="\{"}).b caxbd yt $::bl { threads confuse eval
c277df42
IZ
514x(~~)*(?:(?:F)?)? x~~ y - -
515^a(?#xxx){3}c aaac y $& aaac
516'^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
517(?<![cd])b dbcb n - -
518(?<![cd])[ab] dbaacb y $& a
519(?<!(c|d))b dbcb n - -
520(?<!(c|d))[ab] dbaacb y $& a
521(?<!cd)[ab] cdaccb y $& b
522^(?:a?b?)*$ a-- n - -
523((?s)^a(.))((?m)^b$) a\nb\nc\n y $1;$2;$3 a\n;\n;b
524((?m)^b$) a\nb\nc\n y $1 b
525(?m)^b a\nb\n y $& b
526(?m)^(b) a\nb\n y $1 b
527((?m)^b) a\nb\n y $1 b
528\n((?m)^b) a\nb\n y $1 b
529((?s).)c(?!.) a\nb\nc\n y $1 \n
530((?s).)c(?!.) a\nb\nc\n y $1:$& \n:\nc
531((?s)b.)c(?!.) a\nb\nc\n y $1 b\n
532((?s)b.)c(?!.) a\nb\nc\n y $1:$& b\n:b\nc
533^b a\nb\nc\n n - -
534()^b a\nb\nc\n n - -
535((?m)^b) a\nb\nc\n y $1 b
536(?(1)a|b) a n - -
537(?(1)b|a) a y $& a
538(x)?(?(1)a|b) a n - -
539(x)?(?(1)b|a) a y $& a
540()?(?(1)b|a) a y $& a
541()(?(1)b|a) a n - -
542()?(?(1)a|b) a y $& a
543^(\()?blah(?(1)(\)))$ (blah) y $2 )
544^(\()?blah(?(1)(\)))$ blah y ($2) ()
545^(\()?blah(?(1)(\)))$ blah) n - -
546^(\()?blah(?(1)(\)))$ (blah n - -
547^(\(+)?blah(?(1)(\)))$ (blah) y $2 )
548^(\(+)?blah(?(1)(\)))$ blah y ($2) ()
549^(\(+)?blah(?(1)(\)))$ blah) n - -
550^(\(+)?blah(?(1)(\)))$ (blah n - -
24b61696
RK
551(?(1?)a|b) a c - Switch condition not recognized
552(?(1)a|b|c) a c - Switch (?(condition)... contains too many branches
e3faa678
NC
553(?(?{0})a|b) a nt - - threads confuse eval
554(?(?{0})b|a) a yt $& a threads confuse eval
555(?(?{1})b|a) a nt - - threads confuse eval
556(?(?{1})a|b) a yt $& a threads confuse eval
c277df42
IZ
557(?(?!a)a|b) a n - -
558(?(?!a)b|a) a y $& a
559(?(?=a)b|a) a n - -
560(?(?=a)a|b) a y $& a
561(?=(a+?))(\1ab) aaab y $2 aab
562^(?=(a+?))\1ab aaab n - -
563(\w+:)+ one: y $1 one:
564$(?<=^(a)) a y $1 a
565(?=(a+?))(\1ab) aaab y $2 aab
566^(?=(a+?))\1ab aaab n - -
567([\w:]+::)?(\w+)$ abcd: n - -
568([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
569([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
570^[^bcd]*(c+) aexycd y $1 c
571(a*)b+ caab y $1 aa
572([\w:]+::)?(\w+)$ abcd: n - -
573([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
574([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
575^[^bcd]*(c+) aexycd y $1 c
e3faa678
NC
576(?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a}) yaaxxaaaacd yt $b 3 threads confuse eval
577(?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a}) yaaxxaaaacd yt $b 4 threads confuse eval
c277df42 578(>a+)ab aaab n - -
fe44a5e8 579(?>a+)b aaab y - -
4599a1de
JH
580([[:]+) a:[b]: y $1 :[
581([[=]+) a=[b]= y $1 =[
582([[.]+) a.[b]. y $1 .[
24b61696
RK
583[a[:xyz: - c - Unmatched [
584[a[:xyz:] - c - POSIX class [:xyz:] unknown
767d463e 585[a[:]b[:c] abc y $& abc
24b61696 586([a[:xyz:]b]+) pbaq c - POSIX class [:xyz:] unknown
b8c5462f
JH
587[a[:]b[:c] abc y $& abc
588([[:alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
589([[:alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
590([[:ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__-- ${nulnul}
591([[:cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}
592([[:digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
593([[:graph:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
594([[:lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd
595([[:print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
596([[:punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __--
597([[:space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1
598([[:word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__
599([[:upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
600([[:xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01
601([[:^alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
602([[:^alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __-- ${nulnul}${ffff}
603([[:^ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${ffff}
604([[:^cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
605([[:^digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
606([[:^lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
607([[:^print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}${ffff}
608([[:^punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
609([[:^space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
610([[:^word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 -- ${nulnul}${ffff}
611([[:^upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd01
612([[:^xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 Xy__-- ${nulnul}${ffff}
24b61696
RK
613[[:foo:]] - c - POSIX class [:foo:] unknown
614[[:^foo:]] - c - POSIX class [:^foo:] unknown
fe44a5e8
IZ
615((?>a+)b) aaab y $1 aaab
616(?>(a+))b aaab y $1 aaa
c277df42 617((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
24b61696 618(?<=x+)y - c - Variable length lookbehind not implemented
9baa0206 619a{37,17} - c - Can't do {n,m} with n > m
cf93c79d
IZ
620\Z a\nb\n y $-[0] 3
621\z a\nb\n y $-[0] 4
622$ a\nb\n y $-[0] 3
623\Z b\na\n y $-[0] 3
624\z b\na\n y $-[0] 4
625$ b\na\n y $-[0] 3
626\Z b\na y $-[0] 3
627\z b\na y $-[0] 3
628$ b\na y $-[0] 3
629'\Z'm a\nb\n y $-[0] 3
630'\z'm a\nb\n y $-[0] 4
631'$'m a\nb\n y $-[0] 1
632'\Z'm b\na\n y $-[0] 3
633'\z'm b\na\n y $-[0] 4
634'$'m b\na\n y $-[0] 1
635'\Z'm b\na y $-[0] 3
636'\z'm b\na y $-[0] 3
637'$'m b\na y $-[0] 1
b85d18e9 638a\Z a\nb\n n - -
cf93c79d
IZ
639a\z a\nb\n n - -
640a$ a\nb\n n - -
641a\Z b\na\n y $-[0] 2
642a\z b\na\n n - -
643a$ b\na\n y $-[0] 2
644a\Z b\na y $-[0] 2
645a\z b\na y $-[0] 2
646a$ b\na y $-[0] 2
a1917ab9 647'a\Z'm a\nb\n n - -
cf93c79d
IZ
648'a\z'm a\nb\n n - -
649'a$'m a\nb\n y $-[0] 0
650'a\Z'm b\na\n y $-[0] 2
651'a\z'm b\na\n n - -
652'a$'m b\na\n y $-[0] 2
653'a\Z'm b\na y $-[0] 2
654'a\z'm b\na y $-[0] 2
655'a$'m b\na y $-[0] 2
656aa\Z aa\nb\n n - -
657aa\z aa\nb\n n - -
658aa$ aa\nb\n n - -
659aa\Z b\naa\n y $-[0] 2
660aa\z b\naa\n n - -
661aa$ b\naa\n y $-[0] 2
662aa\Z b\naa y $-[0] 2
663aa\z b\naa y $-[0] 2
664aa$ b\naa y $-[0] 2
a1917ab9 665'aa\Z'm aa\nb\n n - -
cf93c79d
IZ
666'aa\z'm aa\nb\n n - -
667'aa$'m aa\nb\n y $-[0] 0
668'aa\Z'm b\naa\n y $-[0] 2
669'aa\z'm b\naa\n n - -
670'aa$'m b\naa\n y $-[0] 2
671'aa\Z'm b\naa y $-[0] 2
672'aa\z'm b\naa y $-[0] 2
673'aa$'m b\naa y $-[0] 2
674aa\Z ac\nb\n n - -
675aa\z ac\nb\n n - -
676aa$ ac\nb\n n - -
677aa\Z b\nac\n n - -
678aa\z b\nac\n n - -
679aa$ b\nac\n n - -
680aa\Z b\nac n - -
681aa\z b\nac n - -
682aa$ b\nac n - -
683'aa\Z'm ac\nb\n n - -
684'aa\z'm ac\nb\n n - -
685'aa$'m ac\nb\n n - -
686'aa\Z'm b\nac\n n - -
687'aa\z'm b\nac\n n - -
688'aa$'m b\nac\n n - -
689'aa\Z'm b\nac n - -
690'aa\z'm b\nac n - -
691'aa$'m b\nac n - -
692aa\Z ca\nb\n n - -
693aa\z ca\nb\n n - -
694aa$ ca\nb\n n - -
695aa\Z b\nca\n n - -
696aa\z b\nca\n n - -
697aa$ b\nca\n n - -
698aa\Z b\nca n - -
699aa\z b\nca n - -
700aa$ b\nca n - -
701'aa\Z'm ca\nb\n n - -
702'aa\z'm ca\nb\n n - -
703'aa$'m ca\nb\n n - -
704'aa\Z'm b\nca\n n - -
705'aa\z'm b\nca\n n - -
706'aa$'m b\nca\n n - -
707'aa\Z'm b\nca n - -
708'aa\z'm b\nca n - -
709'aa$'m b\nca n - -
710ab\Z ab\nb\n n - -
711ab\z ab\nb\n n - -
712ab$ ab\nb\n n - -
713ab\Z b\nab\n y $-[0] 2
714ab\z b\nab\n n - -
715ab$ b\nab\n y $-[0] 2
716ab\Z b\nab y $-[0] 2
717ab\z b\nab y $-[0] 2
718ab$ b\nab y $-[0] 2
a1917ab9 719'ab\Z'm ab\nb\n n - -
cf93c79d
IZ
720'ab\z'm ab\nb\n n - -
721'ab$'m ab\nb\n y $-[0] 0
722'ab\Z'm b\nab\n y $-[0] 2
723'ab\z'm b\nab\n n - -
724'ab$'m b\nab\n y $-[0] 2
725'ab\Z'm b\nab y $-[0] 2
726'ab\z'm b\nab y $-[0] 2
727'ab$'m b\nab y $-[0] 2
728ab\Z ac\nb\n n - -
729ab\z ac\nb\n n - -
730ab$ ac\nb\n n - -
731ab\Z b\nac\n n - -
732ab\z b\nac\n n - -
733ab$ b\nac\n n - -
734ab\Z b\nac n - -
735ab\z b\nac n - -
736ab$ b\nac n - -
737'ab\Z'm ac\nb\n n - -
738'ab\z'm ac\nb\n n - -
739'ab$'m ac\nb\n n - -
740'ab\Z'm b\nac\n n - -
741'ab\z'm b\nac\n n - -
742'ab$'m b\nac\n n - -
743'ab\Z'm b\nac n - -
744'ab\z'm b\nac n - -
745'ab$'m b\nac n - -
746ab\Z ca\nb\n n - -
747ab\z ca\nb\n n - -
748ab$ ca\nb\n n - -
749ab\Z b\nca\n n - -
750ab\z b\nca\n n - -
751ab$ b\nca\n n - -
752ab\Z b\nca n - -
753ab\z b\nca n - -
754ab$ b\nca n - -
755'ab\Z'm ca\nb\n n - -
756'ab\z'm ca\nb\n n - -
757'ab$'m ca\nb\n n - -
758'ab\Z'm b\nca\n n - -
759'ab\z'm b\nca\n n - -
760'ab$'m b\nca\n n - -
761'ab\Z'm b\nca n - -
762'ab\z'm b\nca n - -
763'ab$'m b\nca n - -
764abb\Z abb\nb\n n - -
765abb\z abb\nb\n n - -
766abb$ abb\nb\n n - -
767abb\Z b\nabb\n y $-[0] 2
768abb\z b\nabb\n n - -
769abb$ b\nabb\n y $-[0] 2
770abb\Z b\nabb y $-[0] 2
771abb\z b\nabb y $-[0] 2
772abb$ b\nabb y $-[0] 2
a1917ab9 773'abb\Z'm abb\nb\n n - -
cf93c79d
IZ
774'abb\z'm abb\nb\n n - -
775'abb$'m abb\nb\n y $-[0] 0
776'abb\Z'm b\nabb\n y $-[0] 2
777'abb\z'm b\nabb\n n - -
778'abb$'m b\nabb\n y $-[0] 2
779'abb\Z'm b\nabb y $-[0] 2
780'abb\z'm b\nabb y $-[0] 2
781'abb$'m b\nabb y $-[0] 2
782abb\Z ac\nb\n n - -
783abb\z ac\nb\n n - -
784abb$ ac\nb\n n - -
785abb\Z b\nac\n n - -
786abb\z b\nac\n n - -
787abb$ b\nac\n n - -
788abb\Z b\nac n - -
789abb\z b\nac n - -
790abb$ b\nac n - -
791'abb\Z'm ac\nb\n n - -
792'abb\z'm ac\nb\n n - -
793'abb$'m ac\nb\n n - -
794'abb\Z'm b\nac\n n - -
795'abb\z'm b\nac\n n - -
796'abb$'m b\nac\n n - -
797'abb\Z'm b\nac n - -
798'abb\z'm b\nac n - -
799'abb$'m b\nac n - -
800abb\Z ca\nb\n n - -
801abb\z ca\nb\n n - -
802abb$ ca\nb\n n - -
803abb\Z b\nca\n n - -
804abb\z b\nca\n n - -
805abb$ b\nca\n n - -
806abb\Z b\nca n - -
807abb\z b\nca n - -
808abb$ b\nca n - -
809'abb\Z'm ca\nb\n n - -
810'abb\z'm ca\nb\n n - -
811'abb$'m ca\nb\n n - -
812'abb\Z'm b\nca\n n - -
813'abb\z'm b\nca\n n - -
814'abb$'m b\nca\n n - -
815'abb\Z'm b\nca n - -
816'abb\z'm b\nca n - -
817'abb$'m b\nca n - -
8e680dc3 818(^|x)(c) ca y $2 c
aca2d497 819a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz x n - -
e3faa678 820a(?{$a=2;$b=3;($b)=$a})b yabz yt $b 2 threads confuse eval
9fe1d20c 821round\(((?>[^()]+))\) _I(round(xs * sz),1) y $1 xs * sz
ce3e6498
HS
822'((?x:.) )' x y $1- x -
823'((?-x:.) )'x x y $1- x-
adac82c7 824foo.bart foo.bart y - -
2c2d71f5
JH
825'^d[x][x][x]'m abcd\ndxxx y - -
826.X(.+)+X bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
827.X(.+)+XX bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
828.XX(.+)+X bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
829.X(.+)+X bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
830.X(.+)+XX bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
831.XX(.+)+X bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
832.X(.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
833.X(.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
834.XX(.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
835.X(.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
836.X(.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
837.XX(.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
838.[X](.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
839.[X](.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
840.[X][X](.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
841.[X](.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
842.[X](.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
843.[X][X](.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
844tt+$ xxxtt y - -
1209ba90 845([a-\d]+) za-9z y $1 a-9
1209ba90 846([\d-z]+) a0-za y $1 0-z
73b437c8 847([\d-\s]+) a0- z y $1 0-
1209ba90 848([a-[:digit:]]+) za-9z y $1 a-9
1209ba90 849([[:digit:]-z]+) =0-z= y $1 0-z
73b437c8 850([[:digit:]-[:alpha:]]+) =0-z= y $1 0-z
30382c73 851\GX.*X aaaXbX n - -
6eb5f6b9
JH
852(\d+\.\d+) 3.1415926 y $1 3.1415926
853(\ba.{0,10}br) have a web browser y $1 a web br
66e933ab
GS
854'\.c(pp|xx|c)?$'i Changes n - -
855'\.c(pp|xx|c)?$'i IO.c y - -
856'(\.c(pp|xx|c)?$)'i IO.c y $1 .c
653099ff 857^([a-z]:) C:/ n - -
60e71179 858'^\S\s+aa$'m \nx aa y - -
de0c8cb8 859(^|a)b ab y - -
f06a1d4e 860^([ab]*?)(b)?(c)$ abac y -$2- --
29d1e993 861(\w)?(abc)\1b abcab n - -
2a8d9689
HS
862^(?:.,){2}c a,b,c y - -
863^(.,){2}c a,b,c y $1 b,
864^(?:[^,]*,){2}c a,b,c y - -
865^([^,]*,){2}c a,b,c y $1 b,
4b2cff9a
HS
866^([^,]*,){3}d aaa,b,c,d y $1 c,
867^([^,]*,){3,}d aaa,b,c,d y $1 c,
868^([^,]*,){0,3}d aaa,b,c,d y $1 c,
869^([^,]{1,3},){3}d aaa,b,c,d y $1 c,
870^([^,]{1,3},){3,}d aaa,b,c,d y $1 c,
871^([^,]{1,3},){0,3}d aaa,b,c,d y $1 c,
872^([^,]{1,},){3}d aaa,b,c,d y $1 c,
873^([^,]{1,},){3,}d aaa,b,c,d y $1 c,
874^([^,]{1,},){0,3}d aaa,b,c,d y $1 c,
875^([^,]{0,3},){3}d aaa,b,c,d y $1 c,
876^([^,]{0,3},){3,}d aaa,b,c,d y $1 c,
877^([^,]{0,3},){0,3}d aaa,b,c,d y $1 c,
bf93d4cc 878(?i) y - -
c2a73568 879'(?!\A)x'm a\nxb\n y - -
c1d44abf
JH
880^(a(b)?)+$ aba y -$1-$2- -a--
881^(aa(bb)?)+$ aabbaa y -$1-$2- -aa--
0e41cd87 882'^.{9}abc.*\n'm 123\nabcabcabcabc\n y - -
66417f84
HS
883^(a)?a$ a y -$1- --
884^(a)?(?(1)a|b)+$ a n - -
cb434fcc
IZ
885^(a\1?)(a\1?)(a\2?)(a\3?)$ aaaaaa y $1,$2,$3,$4 a,aa,a,aa
886^(a\1?){4}$ aaaaaa y $1 aa
887^(0+)?(?:x(1))? x1 y - -
888^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))? 012cxx0190 y - -
e1901655
IZ
889^(b+?|a){1,2}c bbbac y $1 a
890^(b+?|a){1,2}c bbbbac y $1 a
2e36c929 891\((\w\. \w+)\) cd. (A. Tw) y -$1- -A. Tw-
f49d4d0f
HS
892((?:aaaa|bbbb)cccc)? aaaacccc y - -
893((?:aaaa|bbbb)cccc)? bbbbcccc y - -
36670241
JH
894(a)?(a)+ a y $1:$2 :a -
895(ab)?(ab)+ ab y $1:$2 :ab -
896(abc)?(abc)+ abc y $1:$2 :abc -
12d33761 897'b\s^'m a\nb\n n - -
ee0b7718 898\ba a y - -
e3faa678 899^(a(??{"(?!)"})|(a)(?{1}))b ab yt $2 a # [ID 20010811.006] threads confuse eval
055bb491
HS
900ab(?i)cd AbCd n - - # [ID 20010809.023]
901ab(?i)cd abCd y - -
f31a99c8
HS
902(A|B)*(?(1)(CD)|(CD)) CD y $2-$3 -CD
903(A|B)*(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
904(A|B)*?(?(1)(CD)|(CD)) CD y $2-$3 -CD # [ID 20010803.016]
905(A|B)*?(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
f65d3ee7 906'^(o)(?!.*\1)'i Oo n - -
24ba5a3c 907(.*)\d+\1 abc12bc y $1 bc
1ac24cf0 908(?m:(foo\s*$)) foo\n bar y $1 foo
a84d97b6
HS
909(.*)c abcd y $1 ab
910(.*)(?=c) abcd y $1 ab
911(.*)(?=c)c abcd yB $1 ab
912(.*)(?=b|c) abcd y $1 ab
913(.*)(?=b|c)c abcd y $1 ab
914(.*)(?=c|b) abcd y $1 ab
915(.*)(?=c|b)c abcd y $1 ab
916(.*)(?=[bc]) abcd y $1 ab
917(.*)(?=[bc])c abcd yB $1 ab
918(.*)(?<=b) abcd y $1 ab
919(.*)(?<=b)c abcd y $1 ab
920(.*)(?<=b|c) abcd y $1 abc
921(.*)(?<=b|c)c abcd y $1 ab
922(.*)(?<=c|b) abcd y $1 abc
923(.*)(?<=c|b)c abcd y $1 ab
924(.*)(?<=[bc]) abcd y $1 abc
925(.*)(?<=[bc])c abcd y $1 ab
926(.*?)c abcd y $1 ab
927(.*?)(?=c) abcd y $1 ab
928(.*?)(?=c)c abcd yB $1 ab
929(.*?)(?=b|c) abcd y $1 a
930(.*?)(?=b|c)c abcd y $1 ab
931(.*?)(?=c|b) abcd y $1 a
932(.*?)(?=c|b)c abcd y $1 ab
933(.*?)(?=[bc]) abcd y $1 a
934(.*?)(?=[bc])c abcd yB $1 ab
935(.*?)(?<=b) abcd y $1 ab
936(.*?)(?<=b)c abcd y $1 ab
937(.*?)(?<=b|c) abcd y $1 ab
938(.*?)(?<=b|c)c abcd y $1 ab
939(.*?)(?<=c|b) abcd y $1 ab
940(.*?)(?<=c|b)c abcd y $1 ab
941(.*?)(?<=[bc]) abcd y $1 ab
942(.*?)(?<=[bc])c abcd y $1 ab
d3aea5f7 9432(]*)?$\1 2 y $& 2
e3faa678 944(??{}) x yt - - threads confuse eval
ecc99935 945a(b)?? abc y <$1> <> # undef [perl #16773]
c152dc43 946(\d{1,3}\.){3,} 128.134.142.8 y <$1> <142.> # [perl #18019]
b0e70d55
HS
947^.{3,4}(.+)\1\z foobarbar y $1 bar # 16 tests for [perl #23171]
948^(?:f|o|b){3,4}(.+)\1\z foobarbar y $1 bar
949^.{3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
950^(?:f|o|b){3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
951^.{3,4}(.+?)\1\z foobarbar y $1 bar
952^(?:f|o|b){3,4}(.+?)\1\z foobarbar y $1 bar
953^.{3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
954^(?:f|o|b){3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
955^.{2,3}?(.+)\1\z foobarbar y $1 bar
956^(?:f|o|b){2,3}?(.+)\1\z foobarbar y $1 bar
957^.{2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
958^(?:f|o|b){2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
959^.{2,3}?(.+?)\1\z foobarbar y $1 bar
960^(?:f|o|b){2,3}?(.+?)\1\z foobarbar y $1 bar
961^.{2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
962^(?:f|o|b){2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
c2b0868c 963.*a(?!(b|cd)*e).*f ......abef n - - # [perl #23030]
e994fd66
AE
964x(?# x c - Sequence (?#... not terminated
965:x(?#: x c - Sequence (?#... not terminated
a3621e74
YO
966(WORDS|WORD)S WORDS y $1 WORD
967(X.|WORDS|X.|WORD)S WORDS y $1 WORD
968(WORDS|WORLD|WORD)S WORDS y $1 WORD
969(X.|WORDS|WORD|Y.)S WORDS y $1 WORD
970(foo|fool|x.|money|parted)$ fool y $1 fool
971(x.|foo|fool|x.|money|parted|y.)$ fool y $1 fool
972(foo|fool|money|parted)$ fool y $1 fool
973(foo|fool|x.|money|parted)$ fools n - -
974(x.|foo|fool|x.|money|parted|y.)$ fools n - -
975(foo|fool|money|parted)$ fools n - -
3dab1dad 976(a|aa|aaa||aaaa|aaaaa|aaaaaa)(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
e3faa678
NC
977(a|aa|aaa||aaaa|aaaaa|aaaaaa)(??{$1&&""})(b|c) aaaaaaaaaaaaaaab yt $1$2 aaaaaab threads confuse eval
978(a|aa|aaa|aaaa|aaaaa|aaaaaa)(??{$1&&"foo"})(b|c) aaaaaaaaaaaaaaab nt - - threads confuse eval
3ab3c9b4
HS
979^(a*?)(?!(aa|aaaa)*$) aaaaaaaaaaaaaaaaaaaa y $1 a # [perl #34195]
980^(a*?)(?!(aa|aaaa)*$)(?=a\z) aaaaaaaa y $1 aaaaaaa
c315bfe8 981^(.)\s+.$(?(1)) A B y $1 A # [perl #37688]
3a2830be
A
982(?:r?)*?r|(.{2,4}) abcde y $1 abcd
983(?!)+?|(.{2,4}) abcde y $1 abcd
7409bbd3 984^(a*?)(?!(a{6}|a{5})*$) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y $+[1] 12 # super-linear cache bug may return 18
dad79028
DM
985^((?>(?:aa)?b)?) aab y $1 aab
986^((?:aa)*)(?:X+((?:\d+|-)(?:X+(.+))?))?$ aaaaX5 y $1 aaaa
3dab1dad
YO
987X(A|B||C|D)Y XXXYYY y $& XY # Trie w/ NOTHING
988(?i:X([A]|[B]|y[Y]y|[D]|)Y) XXXYYYB y $& XY # Trie w/ NOTHING
40a82448 989^([a]{1})*$ aa y $1 a
3298f257
DM
990a(?!b(?!c))(..) abababc y $1 bc # test nested negatives
991a(?!b(?=a))(..) abababc y $1 bc # test nested lookaheads
992a(?!b(?!c(?!d(?!e))))...(.) abxabcdxabcde y $1 e
993X(?!b+(?!(c+)*(?!(c+)*d))).*X aXbbbbbbbcccccccccccccaaaX y - -
786e8c11
YO
994^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
995^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
996^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
997^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
998^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
999^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1000^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1001^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1002^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1003^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1004^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1005^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1006X(?:ABCF[cC]x*|ABCD|ABCF):(?:DIT|DID|DIM) XABCFCxxxxxxxxxx:DIM y $& XABCFCxxxxxxxxxx:DIM
1007(((ABCD|ABCE|ABCF)))(A|B|C[xy]*): ABCFCxxxxxxxxxx:DIM y $& ABCFCxxxxxxxxxx:
1de06328
YO
1008(?=foo) foo y pos 0
1009(?=foo) XfooY y pos 1
1010.*(?=foo) XfooY y pos 1
1011(?<=foo) foo y pos 3
1012(?<=foo) XfooY y pos 4
1013.*(?<=foo) foo y pos 3
1014.*(?<=foo) XfooY y pos 4
1015(?<=foo)Y XfooY y pos 5
1016o(?<=foo)Y ..XfooY.. y pos 7
1017X(?=foo)f ..XfooY.. y pos 4
1018X(?=foo) ..XfooY.. y pos 3
1019X(?<=foo.)[YZ] ..XfooXY.. y pos 8
1020(?=XY*foo) Xfoo y pos 0
1021^(?=XY*foo) Xfoo y pos 0
e3faa678
NC
1022^(??{"a+"})a aa yt $& aa threads confuse eval
1023^(?:(??{"a+"})|b)a aa yt $& aa threads confuse eval
1024^(??{chr 0x100}).$ \x{100}\x{100} yt $& \x{100}\x{100} threads confuse eval
1025^(??{q(\x{100})}). \x{100}\x{100} yt $& \x{100}\x{100} threads confuse eval
1026^(??{q(.+)})\x{100} \x{100}\x{100} yt $& \x{100}\x{100} threads confuse eval
1027^(??{q(.)})\x{100} \x{100}\x{100} yt $& \x{100}\x{100} threads confuse eval
1028^(??{chr 0x100})\xbb \x{100}\x{bb} yt $& \x{100}\x{bb} threads confuse eval
1029^(.)(??{"(.)(.)"})(.)$ abcd yt $1-$2 a-d threads confuse eval
1030^(.)(??{"(bz+|.)(.)"})(.)$ abcd yt $1-$2 a-d threads confuse eval
1031^(.)((??{"(.)(cz+)"})|.) abcd yt $1-$2 a-b threads confuse eval
1032^a(?>(??{q(b)}))(??{q(c)})d abcd yt - - threads confuse eval
1033^x(??{""})+$ x yt $& x threads confuse eval
6bda09f9
YO
1034^(<(?:[^<>]+|(?3)|(?1))*>)()(!>!>!>)$ <<!>!>!>><>>!>!>!> y $1 <<!>!>!>><>>
1035^(<(?:[^<>]+|(?1))*>)$ <<><<<><>>>> y $1 <<><<<><>>>>
1036((?2)*)([fF]o+) fooFoFoo y $1-$2 fooFo-Foo
1037(<(?:[^<>]+|(?R))*>) <<><<<><>>>> y $1 <<><<<><>>>>
81714fb9
YO
1038(?<n>foo|bar|baz) snofooewa y $1 foo
1039(?<n>foo|bar|baz) snofooewa y $+{n} foo
1040(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa y $+{n} foo
1041(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa y $+{m} ew
1042(?<n>foo)|(?<n>bar)|(?<n>baz) snofooewa y $+{n} foo
e3faa678 1043(?<n>foo)(??{ $+{n} }) snofooefoofoowaa yt $+{n} foo threads confuse eval
1f1031fe
YO
1044(?P<n>foo|bar|baz) snofooewa y $1 foo
1045(?P<n>foo|bar|baz) snofooewa y $+{n} foo
1046(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa y $+{n} foo
1047(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa y $+{m} ew
1048(?P<n>foo)|(?P<n>bar)|(?P<n>baz) snofooewa y $+{n} foo
e3faa678 1049(?P<n>foo)(??{ $+{n} }) snofooefoofoowaa yt $+{n} foo threads confuse eval
1f1031fe
YO
1050(?P<=n>foo|bar|baz) snofooewa c - Sequence (?P<=...) not recognized
1051(?P<!n>foo|bar|baz) snofooewa c - Sequence (?P<!...) not recognized
1052(?PX<n>foo|bar|baz) snofooewa c - Sequence (?PX<...) not recognized
81714fb9
YO
1053/(?'n'foo|bar|baz)/ snofooewa y $1 foo
1054/(?'n'foo|bar|baz)/ snofooewa y $+{n} foo
1055/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa y $+{n} foo
1056/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa y $+{m} ew
1057/(?'n'foo)|(?'n'bar)|(?<n>baz)/ snobazewa y $+{n} baz
e3faa678 1058/(?'n'foo)(??{ $+{n} })/ snofooefoofoowaa yt $+{n} foo threads confuse eval
81714fb9
YO
1059/(?'n'foo)\k<n>/ ..foofoo.. y $1 foo
1060/(?'n'foo)\k<n>/ ..foofoo.. y $+{n} foo
1061/(?<n>foo)\k'n'/ ..foofoo.. y $1 foo
1062/(?<n>foo)\k'n'/ ..foofoo.. y $+{n} foo
1063/(?:(?<n>foo)|(?<n>bar))\k<n>/ ..barbar.. y $+{n} bar
894be9b7
YO
1064/^(?'main'<(?:[^<>]+|(?&crap)|(?&main))*>)(?'empty')(?'crap'!>!>!>)$/ <<!>!>!>><>>!>!>!> y $+{main} <<!>!>!>><>>
1065/^(?'main'<(?:[^<>]+|(?&main))*>)$/ <<><<<><>>>> y $1 <<><<<><>>>>
1066/(?'first'(?&second)*)(?'second'[fF]o+)/ fooFoFoo y $+{first}-$+{second} fooFo-Foo
0a4db386
YO
1067(?<A>foo)?(?(<A>)bar|nada) foobar y $+{A} foo
1068(?<A>foo)?(?(<A>)bar|nada) foo-barnada y $& nada
1069(?<A>foo)?(?(1)bar|nada) foo-barnada y $& nada
1070(?<A>foo(?(R)bar))?(?1) foofoobar y $1 foo
1071(?<A>foo(?(R)bar))?(?1) foofoobar y $& foofoobar
1072(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $2 foo
1073(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $& xfoofoobar
1074(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $2 foo
1075(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $& xfoofoobar
1076(?1)(?(DEFINE)(blah)) blah y $& blah
1077/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamimadam y $& madamimadam
1078/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamiamadam n - -
1079/(a)?((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1080/(a)*((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1081/(a)+((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1082/(a){1,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1083/(a){0,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1084/(ab)?((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1085/(ab)*((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1086/(ab)+((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1087/(ab){1,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1088/(ab){0,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
b9b4dddf
YO
1089# possessive captures
1090a++a aaaaa n - -
1091a*+a aaaaa n - -
1092a{1,5}+a aaaaa n - -
1093a?+a ab n - -
1094a++b aaaaab y $& aaaaab
1095a*+b aaaaab y $& aaaaab
1096a{1,5}+b aaaaab y $& aaaaab
1097a?+b ab y $& ab
1098fooa++a fooaaaaa n - -
1099fooa*+a fooaaaaa n - -
1100fooa{1,5}+a fooaaaaa n - -
1101fooa?+a fooab n - -
1102fooa++b fooaaaaab y $& fooaaaaab
1103fooa*+b fooaaaaab y $& fooaaaaab
1104fooa{1,5}+b fooaaaaab y $& fooaaaaab
1105fooa?+b fooab y $& fooab
1106(?:aA)++(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1107(aA)++(aA) aAaAaAaAaA n - aAaAaAaAaA
1108(aA|bB)++(aA|bB) aAaAbBaAbB n - aAaAbBaAbB
1109(?:aA|bB)++(?:aA|bB) aAbBbBbBaA n - aAbBbBbBaA
1110(?:aA)*+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1111(aA)*+(aA) aAaAaAaAaA n - aAaAaAaAaA
1112(aA|bB)*+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1113(?:aA|bB)*+(?:aA|bB) aAaAaAbBaA n - aAaAaAbBaA
1114(?:aA){1,5}+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1115(aA){1,5}+(aA) aAaAaAaAaA n - aAaAaAaAaA
1116(aA|bB){1,5}+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1117(?:aA|bB){1,5}+(?:aA|bB) bBbBbBbBbB n - bBbBbBbBbB
1118(?:aA)?+(?:aA) aAb n - aAb
1119(aA)?+(aA) aAb n - aAb
1120(aA|bB)?+(aA|bB) bBb n - bBb
1121(?:aA|bB)?+(?:aA|bB) aAb n - aAb
1122(?:aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1123(aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1124(aA|bB)++b aAbBaAaAbBb y $& aAbBaAaAbBb
1125(?:aA|bB)++b aAbBbBaAaAb y $& aAbBbBaAaAb
1126(?:aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1127(aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1128(aA|bB)*+b bBbBbBbBbBb y $& bBbBbBbBbBb
1129(?:aA|bB)*+b bBaAbBbBaAb y $& bBaAbBbBaAb
1130(?:aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1131(aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1132(aA|bB){1,5}+b bBaAbBaAbBb y $& bBaAbBaAbBb
1133(?:aA|bB){1,5}+b aAbBaAbBbBb y $& aAbBaAbBbBb
1134(?:aA)?+b aAb y $& aAb
1135(aA)?+b aAb y $& aAb
1136(aA|bB)?+b bBb y $& bBb
1137(?:aA|bB)?+b bBb y $& bBb
1138foo(?:aA)++(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1139foo(aA)++(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1140foo(aA|bB)++(aA|bB) foobBbBbBaAaA n - foobBbBbBaAaA
1141foo(?:aA|bB)++(?:aA|bB) fooaAaAaAaAaA n - fooaAaAaAaAaA
1142foo(?:aA)*+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1143foo(aA)*+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1144foo(aA|bB)*+(aA|bB) foobBaAbBaAaA n - foobBaAbBaAaA
1145foo(?:aA|bB)*+(?:aA|bB) fooaAaAbBbBaA n - fooaAaAbBbBaA
1146foo(?:aA){1,5}+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1147foo(aA){1,5}+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1148foo(aA|bB){1,5}+(aA|bB) fooaAbBbBaAaA n - fooaAbBbBaAaA
1149foo(?:aA|bB){1,5}+(?:aA|bB) fooaAbBbBaAbB n - fooaAbBbBaAbB
1150foo(?:aA)?+(?:aA) fooaAb n - fooaAb
1151foo(aA)?+(aA) fooaAb n - fooaAb
1152foo(aA|bB)?+(aA|bB) foobBb n - foobBb
1153foo(?:aA|bB)?+(?:aA|bB) fooaAb n - fooaAb
1154foo(?:aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1155foo(aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1156foo(aA|bB)++b foobBaAbBaAbBb y $& foobBaAbBaAbBb
1157foo(?:aA|bB)++b fooaAaAbBaAaAb y $& fooaAaAbBaAaAb
1158foo(?:aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1159foo(aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1160foo(aA|bB)*+b foobBbBaAaAaAb y $& foobBbBaAaAaAb
1161foo(?:aA|bB)*+b foobBaAaAbBaAb y $& foobBaAaAbBaAb
1162foo(?:aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1163foo(aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1164foo(aA|bB){1,5}+b foobBaAaAaAaAb y $& foobBaAaAaAaAb
1165foo(?:aA|bB){1,5}+b fooaAbBaAbBbBb y $& fooaAbBaAbBbBb
1166foo(?:aA)?+b fooaAb y $& fooaAb
1167foo(aA)?+b fooaAb y $& fooaAb
1168foo(aA|bB)?+b foobBb y $& foobBb
1169foo(?:aA|bB)?+b foobBb y $& foobBb
1170
1171([^()]++|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
1172round\(([^()]++)\) _I(round(xs * sz),1) y $1 xs * sz
1173
7f69552c
YO
1174(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $1 baz3
1175(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $& foo1bar2baz3y
1176(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $1 baz3
1177(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $& foo1bar2baz3y
1178
1179([yX].|WORDS|[yX].|WORD)S WORDS y $1 WORD
1180(WORDS|WORLD|WORD)S WORDS y $1 WORD
1181([yX].|WORDS|WORD|[xY].)S WORDS y $1 WORD
1182(foo|fool|[zx].|money|parted)$ fool y $1 fool
1183([zx].|foo|fool|[zq].|money|parted|[yx].)$ fool y $1 fool
1184(foo|fool|[zx].|money|parted)$ fools n - -
1185([zx].|foo|fool|[qx].|money|parted|[py].)$ fools n - -
1186
1187([yX].|WORDS|[yX].|WORD)+S WORDS y $1 WORD
1188(WORDS|WORLD|WORD)+S WORDS y $1 WORD
1189([yX].|WORDS|WORD|[xY].)+S WORDS y $1 WORD
1190(foo|fool|[zx].|money|parted)+$ fool y $1 fool
1191([zx].|foo|fool|[zq].|money|parted|[yx].)+$ fool y $1 fool
1192(foo|fool|[zx].|money|parted)+$ fools n - -
1193([zx].|foo|fool|[qx].|money|parted|[py].)+$ fools n - -
1194
1195(x|y|z[QW])+(longish|loquatious|excessive|overblown[QW])+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1196(x|y|z[QW])*(longish|loquatious|excessive|overblown[QW])* xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1197(x|y|z[QW]){1,5}(longish|loquatious|excessive|overblown[QW]){1,5} xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1198
1199(x|y|z[QW])++(longish|loquatious|excessive|overblown[QW])++ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1200(x|y|z[QW])*+(longish|loquatious|excessive|overblown[QW])*+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1201(x|y|z[QW]){1,5}+(longish|loquatious|excessive|overblown[QW]){1,5}+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1202
7f69552c 1203a*(?!) aaaab n - -
e2e6a0f1
YO
1204a*(*FAIL) aaaab n - -
1205a*(*F) aaaab n - -
1206
1207(A(A|B(*ACCEPT)|C)D)(E) AB y $1 AB
1208(A(A|B(*ACCEPT)|C)D)(E) ACDE y $1$2$3 ACDCE
1209
542fa716 1210(a)(?:(?-1)|(?+1))(b) aab y $&-$1-$2 aab-a-b
c74340f9 1211(a)(?:(?-1)|(?+1))(b) abb y $1-$2 a-b
542fa716 1212(a)(?:(?-1)|(?+1))(b) acb n - -
c74340f9 1213
2bf803e2
YO
1214(foo)(\g-2) foofoo y $1-$2 foo-foo
1215(foo)(\g-2)(foo)(\g-2) foofoofoofoo y $1-$2-$3-$4 foo-foo-foo-foo
1216(([abc]+) \g-1)(([abc]+) \g{-1}) abc abccba cba y $2-$4 abc-cba
1217(a)(b)(c)\g1\g2\g3 abcabc y $1$2$3 abc
1218
1f1031fe 1219# \k<n> preceded by a literal
99ed40ff
YO
1220/(?'n'foo) \k<n>/ ..foo foo.. y $1 foo
1221/(?'n'foo) \k<n>/ ..foo foo.. y $+{n} foo
1222/(?<n>foo) \k'n'/ ..foo foo.. y $1 foo
1223/(?<n>foo) \k'n'/ ..foo foo.. y $+{n} foo
1f1031fe
YO
1224/(?'a1'foo) \k'a1'/ ..foo foo.. y $+{a1} foo
1225/(?<a1>foo) \k<a1>/ ..foo foo.. y $+{a1} foo
1226/(?'_'foo) \k'_'/ ..foo foo.. y $+{_} foo
1227/(?<_>foo) \k<_>/ ..foo foo.. y $+{_} foo
1228/(?'_0_'foo) \k'_0_'/ ..foo foo.. y $+{_0_} foo
1229/(?<_0_>foo) \k<_0_>/ ..foo foo.. y $+{_0_} foo
1230/(?'0'foo) bar/ ..foo bar.. c - Sequence (?'
1231/(?<0>foo) bar/ ..foo bar.. c - Sequence (?<
1232/(?'12'foo) bar/ ..foo bar.. c - Sequence (?'
1233/(?<12>foo) bar/ ..foo bar.. c - Sequence (?<
1234/(?'1a'foo) bar/ ..foo bar.. c - Sequence (?'
1235/(?<1a>foo) bar/ ..foo bar.. c - Sequence (?<
1236/(?''foo) bar/ ..foo bar.. c - Sequence (?''
1237/(?<>foo) bar/ ..foo bar.. c - Sequence (?<>
1238/foo \k'n'/ foo foo c - Reference to nonexistent named group
1239/foo \k<n>/ foo foo c - Reference to nonexistent named group
1240/foo \k'a1'/ foo foo c - Reference to nonexistent named group
1241/foo \k<a1>/ foo foo c - Reference to nonexistent named group
1242/foo \k'_'/ foo foo c - Reference to nonexistent named group
1243/foo \k<_>/ foo foo c - Reference to nonexistent named group
1244/foo \k'_0_'/ foo foo c - Reference to nonexistent named group
1245/foo \k<_0_>/ foo foo c - Reference to nonexistent named group
1246/foo \k'0'/ foo foo c - Sequence \\k'
1247/foo \k<0>/ foo foo c - Sequence \\k<
1248/foo \k'12'/ foo foo c - Sequence \\k'
1249/foo \k<12>/ foo foo c - Sequence \\k<
1250/foo \k'1a'/ foo foo c - Sequence \\k'
1251/foo \k<1a>/ foo foo c - Sequence \\k<
1252/foo \k''/ foo foo c - Sequence \\k'
1253/foo \k<>/ foo foo c - Sequence \\k<
99ed40ff 1254/(?<as>as) (\w+) \k<as> (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1f1031fe
YO
1255
1256# \g{...} with a name as the argument
1257/(?'n'foo) \g{n}/ ..foo foo.. y $1 foo
1258/(?'n'foo) \g{n}/ ..foo foo.. y $+{n} foo
1259/(?<n>foo) \g{n}/ ..foo foo.. y $1 foo
1260/(?<n>foo) \g{n}/ ..foo foo.. y $+{n} foo
1261/(?<as>as) (\w+) \g{as} (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1262
1263# Python style named capture buffer stuff
1264/(?P<n>foo)(?P=n)/ ..foofoo.. y $1 foo
1265/(?P<n>foo)(?P=n)/ ..foofoo.. y $+{n} foo
1266/(?:(?P<n>foo)|(?P<n>bar))(?P=n)/ ..barbar.. y $+{n} bar
1267/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamimadam y $& madamimadam
1268/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamiamadam n - -
1269/(?P<n>foo) (?P=n)/ ..foo foo.. y $1 foo
1270/(?P<n>foo) (?P=n)/ ..foo foo.. y $+{n} foo
1271/(?P<as>as) (\w+) (?P=as) (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1272
1273#check that non identifiers as names are treated as the appropriate lookaround
1274(?<=bar>)foo bar>foo y $& foo
1275(?<!bar>)foo bar>foo n - -
1276(?<=bar>ABC)foo bar>ABCfoo y $& foo
1277(?<!bar>ABC)foo bar>ABCfoo n - -
1278(?<bar>)foo bar>ABCfoo y $& foo
68ba3a3f
YO
1279(?<bar>ABC)foo bar>ABCfoo y $& ABCfoo
1280
1281(?<=abcd(?<=(aaaabcd))) ..aaaabcd.. y $1 aaaabcd
1282(?=xy(?<=(aaxy))) ..aaxy.. y $1 aaxy
fae667d5
YO
1283
1284X(\w+)(?=\s)|X(\w+) Xab y [$1-$2] [-ab]
594d7033
YO
1285
1286#check that branch reset works ok.
1287(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) d!o!da y $1-$2-$3 !o!-o-a
1288(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) aabc y $1-$2-$3 a--c
1289(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) ixyjp y $1-$2-$3 x-y-p
1290(?|(?|(a)|(b))|(?|(c)|(d))) a y $1 a
1291(?|(?|(a)|(b))|(?|(c)|(d))) b y $1 b
1292(?|(?|(a)|(b))|(?|(c)|(d))) c y $1 c
1293(?|(?|(a)|(b))|(?|(c)|(d))) d y $1 d
1294(.)(?|(.)(.)x|(.)d)(.) abcde y $1-$2-$3-$4-$5- b-c--e--
3e901dc0
YO
1295#Bug #41492
1296(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) a y $& a
1297(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) aa y $& aa
e3faa678 1298\x{100}?(??{""})xxx xxx yt $& xxx threads confuse eval
e1d1eefb
YO
1299
1300foo(\R)bar foo\r\nbar y $1 \r\n
1301foo(\R)bar foo\nbar y $1 \n
1302foo(\R)bar foo\rbar y $1 \r
1303
1304foo(\R+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1305(\V+)(\R) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r\n
1306(\R+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1307foo(\R)bar foo\x{85}bar y $1 \x{85}
1308(\V)(\R) foo\x{85}bar y $1-$2 o-\x{85}
1309(\R)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1310foo(\R)bar foo\r\nbar y $1 \r\n
1311(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1312(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1313foo(\R)bar foo\r\nbar y $1 \r\n
1314(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1315(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1316foo(\R)bar foo\rbar y $1 \r
1317(\V)(\R) foo\rbar y $1-$2 o-\r
1318(\R)(\V) foo\rbar y $1-$2 \r-b
1319
1320foo(\v+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1321(\V+)(\v) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r
1322(\v+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1323foo(\v)bar foo\x{85}bar y $1 \x{85}
1324(\V)(\v) foo\x{85}bar y $1-$2 o-\x{85}
1325(\v)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1326foo(\v)bar foo\rbar y $1 \r
1327(\V)(\v) foo\rbar y $1-$2 o-\r
1328(\v)(\V) foo\rbar y $1-$2 \r-b
1329
1330
1331foo(\h+)bar foo\t\x{A0}bar y $1 \t\x{A0}
1332(\H+)(\h) foo\t\x{A0}bar y $1-$2 foo-\t
1333(\h+)(\H) foo\t\x{A0}bar y $1-$2 \t\x{A0}-b
1334foo(\h)bar foo\x{A0}bar y $1 \x{A0}
1335(\H)(\h) foo\x{A0}bar y $1-$2 o-\x{A0}
1336(\h)(\H) foo\x{A0}bar y $1-$2 \x{A0}-b
1337foo(\h)bar foo\tbar y $1 \t
1338(\H)(\h) foo\tbar y $1-$2 o-\t
1339(\h)(\H) foo\tbar y $1-$2 \t-b
5339e136
YO
1340
1341.*\z foo\n y - -
225593e1 1342^(?:(\d)x)?\d$ 1 y ${\(defined($1)?1:0)} 0
60f65011 1343.*?(?:(\w)|(\w))x abx y $1-$2 b-