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