This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add Todo test for Perl #114272
[perl5.git] / t / re / re_tests
CommitLineData
5a51db05 1# This stops me getting screenfulls of syntax errors every time I accidentally
1380b51d
DM
2# run this file via a shell glob. The full format of this file is given
3# in regexp.t
2258fb6a 4# Prior to the implementation of autoloading of \N{}, tests that used \N{name}
538b2691
KW
5# could not go in this file, and were farmed out to other .t's, where they
6# remain
1380b51d
DM
7#
8# pat string y/n/etc expr expected-expr skip-reason
5a51db05 9__END__
378cc40b 10abc abc y $& abc
301f462a
MJD
11abc abc y $-[0] 0
12abc abc y $+[0] 3
378cc40b
LW
13abc xbc n - -
14abc axc n - -
15abc abx n - -
16abc xabcy y $& abc
301f462a
MJD
17abc xabcy y $-[0] 1
18abc xabcy y $+[0] 4
378cc40b 19abc ababc y $& abc
301f462a
MJD
20abc ababc y $-[0] 2
21abc ababc y $+[0] 5
378cc40b 22ab*c abc y $& abc
301f462a
MJD
23ab*c abc y $-[0] 0
24ab*c abc y $+[0] 3
378cc40b 25ab*bc abc y $& abc
301f462a
MJD
26ab*bc abc y $-[0] 0
27ab*bc abc y $+[0] 3
378cc40b 28ab*bc abbc y $& abbc
301f462a
MJD
29ab*bc abbc y $-[0] 0
30ab*bc abbc y $+[0] 4
378cc40b 31ab*bc abbbbc y $& abbbbc
301f462a
MJD
32ab*bc abbbbc y $-[0] 0
33ab*bc abbbbc y $+[0] 6
c277df42 34.{1} abbbbc y $& a
301f462a
MJD
35.{1} abbbbc y $-[0] 0
36.{1} abbbbc y $+[0] 1
c277df42 37.{3,4} abbbbc y $& abbb
301f462a
MJD
38.{3,4} abbbbc y $-[0] 0
39.{3,4} abbbbc y $+[0] 4
afefe6bf
RGS
40\N{1} abbbbc y $& a
41\N{1} abbbbc y $-[0] 0
42\N{1} abbbbc y $+[0] 1
c3c41406
KW
43/\N {1}/x abbbbc y $& a
44/\N {1}/x abbbbc y $-[0] 0
45/\N {1}/x abbbbc y $+[0] 1
afefe6bf
RGS
46\N{3,4} abbbbc y $& abbb
47\N{3,4} abbbbc y $-[0] 0
48\N{3,4} abbbbc y $+[0] 4
c3c41406
KW
49/\N {3,4}/x abbbbc y $& abbb
50/\N {3,4}/x abbbbc y $-[0] 0
51/\N {3,4}/x abbbbc y $+[0] 4
a687059c 52ab{0,}bc abbbbc y $& abbbbc
301f462a
MJD
53ab{0,}bc abbbbc y $-[0] 0
54ab{0,}bc abbbbc y $+[0] 6
378cc40b 55ab+bc abbc y $& abbc
301f462a
MJD
56ab+bc abbc y $-[0] 0
57ab+bc abbc y $+[0] 4
378cc40b
LW
58ab+bc abc n - -
59ab+bc abq n - -
a687059c 60ab{1,}bc abq n - -
378cc40b 61ab+bc abbbbc y $& abbbbc
301f462a
MJD
62ab+bc abbbbc y $-[0] 0
63ab+bc abbbbc y $+[0] 6
a687059c 64ab{1,}bc abbbbc y $& abbbbc
301f462a
MJD
65ab{1,}bc abbbbc y $-[0] 0
66ab{1,}bc abbbbc y $+[0] 6
a687059c 67ab{1,3}bc abbbbc y $& abbbbc
301f462a
MJD
68ab{1,3}bc abbbbc y $-[0] 0
69ab{1,3}bc abbbbc y $+[0] 6
a687059c 70ab{3,4}bc abbbbc y $& abbbbc
301f462a
MJD
71ab{3,4}bc abbbbc y $-[0] 0
72ab{3,4}bc abbbbc y $+[0] 6
a687059c 73ab{4,5}bc abbbbc n - -
378cc40b
LW
74ab?bc abbc y $& abbc
75ab?bc abc y $& abc
a687059c 76ab{0,1}bc abc y $& abc
378cc40b
LW
77ab?bc abbbbc n - -
78ab?c abc y $& abc
a687059c 79ab{0,1}c abc y $& abc
378cc40b
LW
80^abc$ abc y $& abc
81^abc$ abcc n - -
82^abc abcc y $& abc
83^abc$ aabc n - -
84abc$ aabc y $& abc
c277df42 85abc$ aabcd n - -
378cc40b
LW
86^ abc y $&
87$ abc y $&
88a.c abc y $& abc
89a.c axc y $& axc
afefe6bf 90a\Nc abc y $& abc
c3c41406 91/a\N c/x abc y $& abc
378cc40b 92a.*c axyzc y $& axyzc
cbf4a129 93a\N*c axyzc y $& axyzc
c3c41406 94/a\N *c/x axyzc y $& axyzc
378cc40b 95a.*c axyzd n - -
afefe6bf 96a\N*c axyzd n - -
c3c41406 97/a\N *c/x axyzd n - -
378cc40b
LW
98a[bc]d abc n - -
99a[bc]d abd y $& abd
3b968408
YO
100a[b]d abd y $& abd
101[a][b][d] abd y $& abd
102.[b]. abd y $& abd
103.[b]. aBd n - -
104(?i:.[b].) abd y $& abd
afefe6bf 105(?i:\N[b]\N) abd y $& abd
378cc40b
LW
106a[b-d]e abd n - -
107a[b-d]e ace y $& ace
108a[b-d] aac y $& ac
109a[-b] a- y $& a-
110a[b-] a- y $& a-
b2a156bd 111a[b-a] - c - Invalid [] range \"b-a\"
24b61696
RK
112a[]b - c - Unmatched [
113a[ - c - Unmatched [
378cc40b
LW
114a] a] y $& a]
115a[]]b a]b y $& a]b
116a[^bc]d aed y $& aed
117a[^bc]d abd n - -
118a[^-b]c adc y $& adc
119a[^-b]c a-c n - -
120a[^]b]c a]c n - -
121a[^]b]c adc y $& adc
bbce6d69 122\ba\b a- y - -
123\ba\b -a y - -
124\ba\b -a- y - -
125\by\b xy n - -
126\by\b yz n - -
127\by\b xyz n - -
128\Ba\B a- n - -
129\Ba\B -a n - -
130\Ba\B -a- n - -
131\By\b xy y - -
301f462a
MJD
132\By\b xy y $-[0] 1
133\By\b xy y $+[0] 2
134\By\b xy y - -
bbce6d69 135\by\B yz y - -
136\By\B xyz y - -
137\w a y - -
138\w - n - -
139\W a n - -
140\W - y - -
141a\sb a b y - -
142a\sb a-b n - -
143a\Sb a b n - -
144a\Sb a-b y - -
145\d 1 y - -
146\d - n - -
147\D 1 n - -
148\D - y - -
149[\w] a y - -
150[\w] - n - -
151[\W] a n - -
152[\W] - y - -
153a[\s]b a b y - -
154a[\s]b a-b n - -
155a[\S]b a b n - -
156a[\S]b a-b y - -
157[\d] 1 y - -
158[\d] - n - -
159[\D] 1 n - -
160[\D] - y - -
378cc40b
LW
161ab|cd abc y $& ab
162ab|cd abcd y $& ab
163()ef def y $&-$1 ef-
301f462a
MJD
164()ef def y $-[0] 1
165()ef def y $+[0] 3
3de645a8 166()\x{100}\x{1000} d\x{100}\x{1000} y $+[0] 3
301f462a
MJD
167()ef def y $-[1] 1
168()ef def y $+[1] 1
24b61696 169*a - c - Quantifier follows nothing
e2e6a0f1
YO
170(|*)b - c - Quantifier follows nothing
171(*)b - c - Unknown verb
378cc40b 172$b b n - -
1b1626e4 173a\ - c - Search pattern not terminated
378cc40b
LW
174a\(b a(b y $&-$1 a(b-
175a\(*b ab y $& ab
176a\(*b a((b y $& a((b
b2a156bd 177a\\b a\\b y $& a\\b
24b61696
RK
178abc) - c - Unmatched )
179(abc - c - Unmatched (
378cc40b 180((a)) abc y $&-$1-$2 a-a-a
301f462a
MJD
181((a)) abc y $-[0]-$-[1]-$-[2] 0-0-0
182((a)) abc y $+[0]-$+[1]-$+[2] 1-1-1
183((a)) abc b @- 0 0 0
184((a)) abc b @+ 1 1 1
378cc40b 185(a)b(c) abc y $&-$1-$2 abc-a-c
301f462a
MJD
186(a)b(c) abc y $-[0]-$-[1]-$-[2] 0-0-2
187(a)b(c) abc y $+[0]-$+[1]-$+[2] 3-1-3
378cc40b 188a+b+c aabbabc y $& abc
a687059c 189a{1,}b{1,}c aabbabc y $& abc
24b61696 190a** - c - Nested quantifiers
a0d0e21e 191a.+?c abcabc y $& abc
378cc40b 192(a+|b)* ab y $&-$1 ab-b
301f462a
MJD
193(a+|b)* ab y $-[0] 0
194(a+|b)* ab y $+[0] 2
195(a+|b)* ab y $-[1] 1
196(a+|b)* ab y $+[1] 2
a687059c 197(a+|b){0,} ab y $&-$1 ab-b
378cc40b 198(a+|b)+ ab y $&-$1 ab-b
a687059c 199(a+|b){1,} ab y $&-$1 ab-b
378cc40b 200(a+|b)? ab y $&-$1 a-a
a687059c 201(a+|b){0,1} ab y $&-$1 a-a
24b61696 202)( - c - Unmatched )
378cc40b
LW
203[^ab]* cde y $& cde
204abc n - -
205a* y $&
206([abc])*d abbbcd y $&-$1 abbbcd-c
207([abc])*bcd abcd y $&-$1 abcd-a
208a|b|c|d|e e y $& e
209(a|b|c|d|e)f ef y $&-$1 ef-e
301f462a
MJD
210(a|b|c|d|e)f ef y $-[0] 0
211(a|b|c|d|e)f ef y $+[0] 2
212(a|b|c|d|e)f ef y $-[1] 0
213(a|b|c|d|e)f ef y $+[1] 1
378cc40b
LW
214abcd*efg abcdefg y $& abcdefg
215ab* xabyabbbz y $& ab
216ab* xayabbbz y $& a
217(ab|cd)e abcde y $&-$1 cde-cd
218[abhgefdc]ij hij y $& hij
219^(ab|cd)e abcde n x$1y xy
220(abc|)ef abcdef y $&-$1 ef-
221(a|b)c*d abcd y $&-$1 bcd-b
222(ab|ab*)bc abc y $&-$1 abc-a
223a([bc]*)c* abc y $&-$1 abc-bc
224a([bc]*)(c*d) abcd y $&-$1-$2 abcd-bc-d
301f462a
MJD
225a([bc]*)(c*d) abcd y $-[0] 0
226a([bc]*)(c*d) abcd y $+[0] 4
227a([bc]*)(c*d) abcd y $-[1] 1
228a([bc]*)(c*d) abcd y $+[1] 3
229a([bc]*)(c*d) abcd y $-[2] 3
230a([bc]*)(c*d) abcd y $+[2] 4
378cc40b
LW
231a([bc]+)(c*d) abcd y $&-$1-$2 abcd-bc-d
232a([bc]*)(c+d) abcd y $&-$1-$2 abcd-b-cd
301f462a
MJD
233a([bc]*)(c+d) abcd y $-[0] 0
234a([bc]*)(c+d) abcd y $+[0] 4
235a([bc]*)(c+d) abcd y $-[1] 1
236a([bc]*)(c+d) abcd y $+[1] 2
237a([bc]*)(c+d) abcd y $-[2] 2
238a([bc]*)(c+d) abcd y $+[2] 4
378cc40b
LW
239a[bcd]*dcdcde adcdcde y $& adcdcde
240a[bcd]+dcdcde adcdcde n - -
241(ab|a)b*c abc y $&-$1 abc-ab
301f462a
MJD
242(ab|a)b*c abc y $-[0] 0
243(ab|a)b*c abc y $+[0] 3
244(ab|a)b*c abc y $-[1] 0
245(ab|a)b*c abc y $+[1] 2
378cc40b 246((a)(b)c)(d) abcd y $1-$2-$3-$4 abc-a-b-d
301f462a
MJD
247((a)(b)c)(d) abcd y $-[0] 0
248((a)(b)c)(d) abcd y $+[0] 4
249((a)(b)c)(d) abcd y $-[1] 0
250((a)(b)c)(d) abcd y $+[1] 3
251((a)(b)c)(d) abcd y $-[2] 0
252((a)(b)c)(d) abcd y $+[2] 1
253((a)(b)c)(d) abcd y $-[3] 1
254((a)(b)c)(d) abcd y $+[3] 2
255((a)(b)c)(d) abcd y $-[4] 3
256((a)(b)c)(d) abcd y $+[4] 4
378cc40b
LW
257[a-zA-Z_][a-zA-Z0-9_]* alpha y $& alpha
258^a(bc+|b[eh])g|.h$ abh y $&-$1 bh-
259(bc+d$|ef*g.|h?i(j|k)) effgz y $&-$1-$2 effgz-effgz-
260(bc+d$|ef*g.|h?i(j|k)) ij y $&-$1-$2 ij-ij-j
261(bc+d$|ef*g.|h?i(j|k)) effg n - -
262(bc+d$|ef*g.|h?i(j|k)) bcdd n - -
263(bc+d$|ef*g.|h?i(j|k)) reffgz y $&-$1-$2 effgz-effgz-
fe14fcc3 264((((((((((a)))))))))) a y $10 a
301f462a
MJD
265((((((((((a)))))))))) a y $-[0] 0
266((((((((((a)))))))))) a y $+[0] 1
267((((((((((a)))))))))) a y $-[10] 0
268((((((((((a)))))))))) a y $+[10] 1
fe14fcc3 269((((((((((a))))))))))\10 aa y $& aa
9d116dd7
JH
270((((((((((a))))))))))${bang} aa n - -
271((((((((((a))))))))))${bang} a! y $& a!
378cc40b
LW
272(((((((((a))))))))) a y $& a
273multiple words of text uh-uh n - -
274multiple words multiple words, yeah y $& multiple words
275(.*)c(.*) abcde y $&-$1-$2 abcde-ab-de
276\((.*), (.*)\) (a, b) y ($2, $1) (b, a)
277[k] ab n - -
b2a156bd
DM
278abcd abcd y $&-\$&-\\$& abcd-\$&-\\abcd
279a(bc)d abcd y $1-\$1-\\$1 bc-\$1-\\bc
378cc40b
LW
280a[-]?c ac y $& ac
281(abc)\1 abcabc y $1 abc
282([a-c]*)\1 abcabc y $1 abc
9baa0206
HS
283\1 - c - Reference to nonexistent group
284\2 - c - Reference to nonexistent group
88307081
RGS
285\g1 - c - Reference to nonexistent group
286\g-1 - c - Reference to nonexistent or unclosed group
287\g{1} - c - Reference to nonexistent group
288\g{-1} - c - Reference to nonexistent or unclosed group
289\g0 - c - Reference to invalid group 0
290\g-0 - c - Reference to invalid group 0
291\g{0} - c - Reference to invalid group 0
292\g{-0} - c - Reference to invalid group 0
ef64f398 293(a)|\1 a y - -
40863337
ML
294(a)|\1 x n - Reference to group in different branch
295(?:(b)?a)\1 a n - Reference to group that did not match
9baa0206 296(a)|\2 - c - Reference to nonexistent group
ef64f398
HS
297(([a-c])b*?\2)* ababbbcbc y $&-$1-$2 ababb-bb-b
298(([a-c])b*?\2){3} ababbbcbc y $&-$1-$2 ababbbcbc-cbc-c
299((\3|b)\2(a)x)+ aaxabxbaxbbx n - -
300((\3|b)\2(a)x)+ aaaxabaxbaaxbbax y $&-$1-$2-$3 bbax-bbax-b-a
301((\3|b)\2(a)){2,} bbaababbabaaaaabbaaaabba y $&-$1-$2-$3 bbaaaabba-bba-b-a
ee1d8f2a
RU
302#Bug #3589 - up to perl-5.6.0 matches incorrectly, from 5.6.1 not anymore
303^((.)?a\2)+$ babadad n - -
301f462a
MJD
304(a)|(b) b y $-[0] 0
305(a)|(b) b y $+[0] 1
306(a)|(b) b y x$-[1] x
307(a)|(b) b y x$+[1] x
308(a)|(b) b y $-[2] 0
309(a)|(b) b y $+[2] 1
1462b684
LW
310'abc'i ABC y $& ABC
311'abc'i XBC n - -
312'abc'i AXC n - -
313'abc'i ABX n - -
314'abc'i XABCY y $& ABC
315'abc'i ABABC y $& ABC
316'ab*c'i ABC y $& ABC
317'ab*bc'i ABC y $& ABC
318'ab*bc'i ABBC y $& ABBC
a0d0e21e
LW
319'ab*?bc'i ABBBBC y $& ABBBBC
320'ab{0,}?bc'i ABBBBC y $& ABBBBC
321'ab+?bc'i ABBC y $& ABBC
1462b684
LW
322'ab+bc'i ABC n - -
323'ab+bc'i ABQ n - -
324'ab{1,}bc'i ABQ n - -
325'ab+bc'i ABBBBC y $& ABBBBC
a0d0e21e
LW
326'ab{1,}?bc'i ABBBBC y $& ABBBBC
327'ab{1,3}?bc'i ABBBBC y $& ABBBBC
328'ab{3,4}?bc'i ABBBBC y $& ABBBBC
329'ab{4,5}?bc'i ABBBBC n - -
330'ab??bc'i ABBC y $& ABBC
331'ab??bc'i ABC y $& ABC
332'ab{0,1}?bc'i ABC y $& ABC
333'ab??bc'i ABBBBC n - -
334'ab??c'i ABC y $& ABC
335'ab{0,1}?c'i ABC y $& ABC
1462b684
LW
336'^abc$'i ABC y $& ABC
337'^abc$'i ABCC n - -
338'^abc'i ABCC y $& ABC
339'^abc$'i AABC n - -
340'abc$'i AABC y $& ABC
341'^'i ABC y $&
342'$'i ABC y $&
343'a.c'i ABC y $& ABC
344'a.c'i AXC y $& AXC
afefe6bf 345'a\Nc'i ABC y $& ABC
a0d0e21e 346'a.*?c'i AXYZC y $& AXYZC
1462b684
LW
347'a.*c'i AXYZD n - -
348'a[bc]d'i ABC n - -
349'a[bc]d'i ABD y $& ABD
350'a[b-d]e'i ABD n - -
351'a[b-d]e'i ACE y $& ACE
352'a[b-d]'i AAC y $& AC
353'a[-b]'i A- y $& A-
354'a[b-]'i A- y $& A-
b2a156bd 355'a[b-a]'i - c - Invalid [] range \"b-a\"
24b61696
RK
356'a[]b'i - c - Unmatched [
357'a['i - c - Unmatched [
1462b684
LW
358'a]'i A] y $& A]
359'a[]]b'i A]B y $& A]B
360'a[^bc]d'i AED y $& AED
361'a[^bc]d'i ABD n - -
362'a[^-b]c'i ADC y $& ADC
363'a[^-b]c'i A-C n - -
364'a[^]b]c'i A]C n - -
365'a[^]b]c'i ADC y $& ADC
366'ab|cd'i ABC y $& AB
367'ab|cd'i ABCD y $& AB
368'()ef'i DEF y $&-$1 EF-
24b61696 369'*a'i - c - Quantifier follows nothing
e2e6a0f1
YO
370'(|*)b'i - c - Quantifier follows nothing
371'(*)b'i - c - Unknown verb
1462b684 372'$b'i B n - -
1b1626e4 373'a\'i - c - Search pattern not terminated
1462b684
LW
374'a\(b'i A(B y $&-$1 A(B-
375'a\(*b'i AB y $& AB
376'a\(*b'i A((B y $& A((B
b2a156bd 377'a\\b'i A\\B y $& A\\B
24b61696
RK
378'abc)'i - c - Unmatched )
379'(abc'i - c - Unmatched (
1462b684
LW
380'((a))'i ABC y $&-$1-$2 A-A-A
381'(a)b(c)'i ABC y $&-$1-$2 ABC-A-C
382'a+b+c'i AABBABC y $& ABC
383'a{1,}b{1,}c'i AABBABC y $& ABC
24b61696 384'a**'i - c - Nested quantifiers
a0d0e21e
LW
385'a.+?c'i ABCABC y $& ABC
386'a.*?c'i ABCABC y $& ABC
387'a.{0,5}?c'i ABCABC y $& ABC
1462b684
LW
388'(a+|b)*'i AB y $&-$1 AB-B
389'(a+|b){0,}'i AB y $&-$1 AB-B
390'(a+|b)+'i AB y $&-$1 AB-B
391'(a+|b){1,}'i AB y $&-$1 AB-B
392'(a+|b)?'i AB y $&-$1 A-A
393'(a+|b){0,1}'i AB y $&-$1 A-A
a0d0e21e 394'(a+|b){0,1}?'i AB y $&-$1 -
24b61696 395')('i - c - Unmatched )
1462b684
LW
396'[^ab]*'i CDE y $& CDE
397'abc'i n - -
398'a*'i y $&
399'([abc])*d'i ABBBCD y $&-$1 ABBBCD-C
400'([abc])*bcd'i ABCD y $&-$1 ABCD-A
401'a|b|c|d|e'i E y $& E
402'(a|b|c|d|e)f'i EF y $&-$1 EF-E
1462b684
LW
403'abcd*efg'i ABCDEFG y $& ABCDEFG
404'ab*'i XABYABBBZ y $& AB
405'ab*'i XAYABBBZ y $& A
406'(ab|cd)e'i ABCDE y $&-$1 CDE-CD
407'[abhgefdc]ij'i HIJ y $& HIJ
408'^(ab|cd)e'i ABCDE n x$1y XY
409'(abc|)ef'i ABCDEF y $&-$1 EF-
410'(a|b)c*d'i ABCD y $&-$1 BCD-B
411'(ab|ab*)bc'i ABC y $&-$1 ABC-A
412'a([bc]*)c*'i ABC y $&-$1 ABC-BC
413'a([bc]*)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
414'a([bc]+)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
415'a([bc]*)(c+d)'i ABCD y $&-$1-$2 ABCD-B-CD
416'a[bcd]*dcdcde'i ADCDCDE y $& ADCDCDE
417'a[bcd]+dcdcde'i ADCDCDE n - -
418'(ab|a)b*c'i ABC y $&-$1 ABC-AB
419'((a)(b)c)(d)'i ABCD y $1-$2-$3-$4 ABC-A-B-D
420'[a-zA-Z_][a-zA-Z0-9_]*'i ALPHA y $& ALPHA
421'^a(bc+|b[eh])g|.h$'i ABH y $&-$1 BH-
422'(bc+d$|ef*g.|h?i(j|k))'i EFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
423'(bc+d$|ef*g.|h?i(j|k))'i IJ y $&-$1-$2 IJ-IJ-J
424'(bc+d$|ef*g.|h?i(j|k))'i EFFG n - -
425'(bc+d$|ef*g.|h?i(j|k))'i BCDD n - -
426'(bc+d$|ef*g.|h?i(j|k))'i REFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
427'((((((((((a))))))))))'i A y $10 A
428'((((((((((a))))))))))\10'i AA y $& AA
9d116dd7
JH
429'((((((((((a))))))))))${bang}'i AA n - -
430'((((((((((a))))))))))${bang}'i A! y $& A!
1462b684 431'(((((((((a)))))))))'i A y $& A
a0d0e21e
LW
432'(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))'i A y $1 A
433'(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))'i C y $1 C
1462b684
LW
434'multiple words of text'i UH-UH n - -
435'multiple words'i MULTIPLE WORDS, YEAH y $& MULTIPLE WORDS
436'(.*)c(.*)'i ABCDE y $&-$1-$2 ABCDE-AB-DE
437'\((.*), (.*)\)'i (A, B) y ($2, $1) (B, A)
438'[k]'i AB n - -
b2a156bd
DM
439'abcd'i ABCD y $&-\$&-\\$& ABCD-\$&-\\ABCD
440'a(bc)d'i ABCD y $1-\$1-\\$1 BC-\$1-\\BC
1462b684
LW
441'a[-]?c'i AC y $& AC
442'(abc)\1'i ABCABC y $1 ABC
443'([a-c]*)\1'i ABCABC y $1 ABC
a0d0e21e 444a(?!b). abad y $& ad
89c6a13e 445(?=)a a y $& a
a0d0e21e
LW
446a(?=d). abad y $& ad
447a(?=c|d). abad y $& ad
448a(?:b|c|d)(.) ace y $1 e
449a(?:b|c|d)*(.) ace y $1 e
450a(?:b|c|d)+?(.) ace y $1 e
c277df42
IZ
451a(?:b|c|d)+?(.) acdbcdbe y $1 d
452a(?:b|c|d)+(.) acdbcdbe y $1 e
453a(?:b|c|d){2}(.) acdbcdbe y $1 b
454a(?:b|c|d){4,5}(.) acdbcdbe y $1 b
455a(?:b|c|d){4,5}?(.) acdbcdbe y $1 d
456((foo)|(bar))* foobar y $1-$2-$3 bar-foo-bar
9baa0206 457:(?: - c - Sequence (? incomplete
c277df42
IZ
458a(?:b|c|d){6,7}(.) acdbcdbe y $1 e
459a(?:b|c|d){6,7}?(.) acdbcdbe y $1 e
460a(?:b|c|d){5,6}(.) acdbcdbe y $1 e
461a(?:b|c|d){5,6}?(.) acdbcdbe y $1 b
462a(?:b|c|d){5,7}(.) acdbcdbe y $1 e
463a(?:b|c|d){5,7}?(.) acdbcdbe y $1 b
a0d0e21e
LW
464a(?:b|(c|e){1,2}?|d)+?(.) ace y $1$2 ce
465^(.+)?B AB y $1 A
c277df42
IZ
466^([^a-z])|(\^)$ . y $1 .
467^[<>]& <&OUT y $& <&
468^(a\1?){4}$ aaaaaaaaaa y $1 aaaa
469^(a\1?){4}$ aaaaaaaaa n - -
470^(a\1?){4}$ aaaaaaaaaaa n - -
af3f8c16
IZ
471^(a(?(1)\1)){4}$ aaaaaaaaaa y $1 aaaa
472^(a(?(1)\1)){4}$ aaaaaaaaa n - -
473^(a(?(1)\1)){4}$ aaaaaaaaaaa n - -
708e3b05
IZ
474((a{4})+) aaaaaaaaa y $1 aaaaaaaa
475(((aa){2})+) aaaaaaaaaa y $1 aaaaaaaa
476(((a{2}){2})+) aaaaaaaaaa y $1 aaaaaaaa
c277df42
IZ
477(?:(f)(o)(o)|(b)(a)(r))* foobar y $1:$2:$3:$4:$5:$6 f:o:o:b:a:r
478(?<=a)b ab y $& b
479(?<=a)b cb n - -
480(?<=a)b b n - -
481(?<!c)b ab y $& b
482(?<!c)b cb n - -
483(?<!c)b b y - -
484(?<!c)b b y $& b
1f4f6bf1 485(?<%)b - c - Group name must start with a non-digit word character
c277df42
IZ
486(?:..)*a aba y $& aba
487(?:..)*?a aba y $& a
488^(?:b|a(?=(.)))*\1 abc y $& ab
489^(){3,5} abc y a$1 a
490^(a+)*ax aax y $1 a
491^((a|b)+)*ax aax y $1 a
492^((a|bc)+)*ax aax y $1 a
493(a|x)*ab cab y y$1 y
494(a)*ab cab y y$1 y
495(?:(?i)a)b ab y $& ab
496((?i)a)b ab y $&:$1 ab:a
497(?:(?i)a)b Ab y $& Ab
498((?i)a)b Ab y $&:$1 Ab:A
499(?:(?i)a)b aB n - -
500((?i)a)b aB n - -
ca9dfc88
IZ
501(?i:a)b ab y $& ab
502((?i:a))b ab y $&:$1 ab:a
503(?i:a)b Ab y $& Ab
504((?i:a))b Ab y $&:$1 Ab:A
505(?i:a)b aB n - -
506((?i:a))b aB n - -
507'(?:(?-i)a)b'i ab y $& ab
508'((?-i)a)b'i ab y $&:$1 ab:a
509'(?:(?-i)a)b'i aB y $& aB
510'((?-i)a)b'i aB y $&:$1 aB:a
511'(?:(?-i)a)b'i Ab n - -
512'((?-i)a)b'i Ab n - -
513'(?:(?-i)a)b'i aB y $& aB
514'((?-i)a)b'i aB y $1 a
515'(?:(?-i)a)b'i AB n - -
516'((?-i)a)b'i AB n - -
517'(?-i:a)b'i ab y $& ab
518'((?-i:a))b'i ab y $&:$1 ab:a
519'(?-i:a)b'i aB y $& aB
520'((?-i:a))b'i aB y $&:$1 aB:a
521'(?-i:a)b'i Ab n - -
522'((?-i:a))b'i Ab n - -
523'(?-i:a)b'i aB y $& aB
524'((?-i:a))b'i aB y $1 a
525'(?-i:a)b'i AB n - -
526'((?-i:a))b'i AB n - -
527'((?-i:a.))b'i a\nB n - -
afefe6bf 528'((?-i:a\N))b'i a\nB n - -
ca9dfc88 529'((?s-i:a.))b'i a\nB y $1 a\n
afefe6bf 530'((?s-i:a\N))b'i a\nB n - -
ca9dfc88 531'((?s-i:a.))b'i B\nB n - -
afefe6bf 532'((?s-i:a\N))b'i B\nB n - -
c277df42
IZ
533(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b))) cabbbb y $& cabbbb
534(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb))) caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb y $& caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
535'(ab)\d\1'i Ab4ab y $1 Ab
536'(ab)\d\1'i ab4Ab y $1 ab
ad4f75a6 537foo\w*\d{4}baz foobar1234baz y $& foobar1234baz
61525e55 538a(?{})b cabd y $& ab
9da1dd8f
DM
539a(?{f()+ - c - Missing right curly or square bracket
540a(?{{1}+ - c - Missing right curly or square bracket
380a0633 541a(?{}})b - c -
b30fcab9 542a(?{"{"})b ab y - -
61525e55 543a(?{"\{"})b cabd y $& ab
9da1dd8f 544a(?{"{"}})b - c - Sequence (?{...}) not terminated with ')'
94c1d7aa 545a(?{$::bl="\{"}).b caxbd y $::bl {
c277df42
IZ
546x(~~)*(?:(?:F)?)? x~~ y - -
547^a(?#xxx){3}c aaac y $& aaac
548'^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
549(?<![cd])b dbcb n - -
550(?<![cd])[ab] dbaacb y $& a
551(?<!(c|d))b dbcb n - -
552(?<!(c|d))[ab] dbaacb y $& a
553(?<!cd)[ab] cdaccb y $& b
554^(?:a?b?)*$ a-- n - -
555((?s)^a(.))((?m)^b$) a\nb\nc\n y $1;$2;$3 a\n;\n;b
556((?m)^b$) a\nb\nc\n y $1 b
557(?m)^b a\nb\n y $& b
558(?m)^(b) a\nb\n y $1 b
559((?m)^b) a\nb\n y $1 b
560\n((?m)^b) a\nb\n y $1 b
561((?s).)c(?!.) a\nb\nc\n y $1 \n
562((?s).)c(?!.) a\nb\nc\n y $1:$& \n:\nc
563((?s)b.)c(?!.) a\nb\nc\n y $1 b\n
564((?s)b.)c(?!.) a\nb\nc\n y $1:$& b\n:b\nc
cbf4a129
RGS
565((?s)b.)c(?!\N) a\nb\nc\n y $1:$& b\n:b\nc
566'(b.)c(?!\N)'s a\nb\nc\n y $1:$& b\n:b\nc
c277df42
IZ
567^b a\nb\nc\n n - -
568()^b a\nb\nc\n n - -
569((?m)^b) a\nb\nc\n y $1 b
570(?(1)a|b) a n - -
571(?(1)b|a) a y $& a
572(x)?(?(1)a|b) a n - -
573(x)?(?(1)b|a) a y $& a
574()?(?(1)b|a) a y $& a
575()(?(1)b|a) a n - -
576()?(?(1)a|b) a y $& a
577^(\()?blah(?(1)(\)))$ (blah) y $2 )
578^(\()?blah(?(1)(\)))$ blah y ($2) ()
579^(\()?blah(?(1)(\)))$ blah) n - -
580^(\()?blah(?(1)(\)))$ (blah n - -
581^(\(+)?blah(?(1)(\)))$ (blah) y $2 )
582^(\(+)?blah(?(1)(\)))$ blah y ($2) ()
583^(\(+)?blah(?(1)(\)))$ blah) n - -
584^(\(+)?blah(?(1)(\)))$ (blah n - -
24b61696
RK
585(?(1?)a|b) a c - Switch condition not recognized
586(?(1)a|b|c) a c - Switch (?(condition)... contains too many branches
61525e55
NC
587(?(?{0})a|b) a n - -
588(?(?{0})b|a) a y $& a
589(?(?{1})b|a) a n - -
590(?(?{1})a|b) a y $& a
c277df42
IZ
591(?(?!a)a|b) a n - -
592(?(?!a)b|a) a y $& a
593(?(?=a)b|a) a n - -
594(?(?=a)a|b) a y $& a
595(?=(a+?))(\1ab) aaab y $2 aab
596^(?=(a+?))\1ab aaab n - -
597(\w+:)+ one: y $1 one:
598$(?<=^(a)) a y $1 a
599(?=(a+?))(\1ab) aaab y $2 aab
600^(?=(a+?))\1ab aaab n - -
601([\w:]+::)?(\w+)$ abcd: n - -
602([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
603([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
604^[^bcd]*(c+) aexycd y $1 c
605(a*)b+ caab y $1 aa
606([\w:]+::)?(\w+)$ abcd: n - -
607([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
608([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
609^[^bcd]*(c+) aexycd y $1 c
94c1d7aa
DM
610(?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a}) yaaxxaaaacd y $b 3
611(?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a}) yaaxxaaaacd y $b 4
c277df42 612(>a+)ab aaab n - -
fe44a5e8 613(?>a+)b aaab y - -
4599a1de
JH
614([[:]+) a:[b]: y $1 :[
615([[=]+) a=[b]= y $1 =[
616([[.]+) a.[b]. y $1 .[
24b61696
RK
617[a[:xyz: - c - Unmatched [
618[a[:xyz:] - c - POSIX class [:xyz:] unknown
767d463e 619[a[:]b[:c] abc y $& abc
24b61696 620([a[:xyz:]b]+) pbaq c - POSIX class [:xyz:] unknown
b8c5462f
JH
621[a[:]b[:c] abc y $& abc
622([[:alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
623([[:alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
624([[:ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__-- ${nulnul}
625([[:cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}
626([[:digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
627([[:graph:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
628([[:lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd
629([[:print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
630([[:punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __--
631([[:space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1
632([[:word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__
633([[:upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
634([[:xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01
635([[:^alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
cfaf538b 636((?a)[[:^alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __-- ${nulnul}${ffff}
b8c5462f
JH
637([[:^ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${ffff}
638([[:^cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
639([[:^digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
640([[:^lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
cfaf538b 641((?a)[[:^print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}${ffff}
b8c5462f
JH
642([[:^punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
643([[:^space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
cfaf538b 644((?a)[[:^word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 -- ${nulnul}${ffff}
b8c5462f
JH
645([[:^upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd01
646([[:^xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 Xy__-- ${nulnul}${ffff}
24b61696
RK
647[[:foo:]] - c - POSIX class [:foo:] unknown
648[[:^foo:]] - c - POSIX class [:^foo:] unknown
fe44a5e8
IZ
649((?>a+)b) aaab y $1 aaab
650(?>(a+))b aaab y $1 aaa
c277df42 651((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
24b61696 652(?<=x+)y - c - Variable length lookbehind not implemented
31c15ce5 653((def){37,17})?ABC ABC y $& ABC
cf93c79d
IZ
654\Z a\nb\n y $-[0] 3
655\z a\nb\n y $-[0] 4
656$ a\nb\n y $-[0] 3
657\Z b\na\n y $-[0] 3
658\z b\na\n y $-[0] 4
659$ b\na\n y $-[0] 3
660\Z b\na y $-[0] 3
661\z b\na y $-[0] 3
662$ b\na y $-[0] 3
663'\Z'm a\nb\n y $-[0] 3
664'\z'm a\nb\n y $-[0] 4
665'$'m a\nb\n y $-[0] 1
666'\Z'm b\na\n y $-[0] 3
667'\z'm b\na\n y $-[0] 4
668'$'m b\na\n y $-[0] 1
669'\Z'm b\na y $-[0] 3
670'\z'm b\na y $-[0] 3
671'$'m b\na y $-[0] 1
b85d18e9 672a\Z a\nb\n n - -
cf93c79d
IZ
673a\z a\nb\n n - -
674a$ a\nb\n n - -
675a\Z b\na\n y $-[0] 2
676a\z b\na\n n - -
677a$ b\na\n y $-[0] 2
678a\Z b\na y $-[0] 2
679a\z b\na y $-[0] 2
680a$ b\na y $-[0] 2
a1917ab9 681'a\Z'm a\nb\n n - -
cf93c79d
IZ
682'a\z'm a\nb\n n - -
683'a$'m a\nb\n y $-[0] 0
684'a\Z'm b\na\n y $-[0] 2
685'a\z'm b\na\n n - -
686'a$'m b\na\n y $-[0] 2
687'a\Z'm b\na y $-[0] 2
688'a\z'm b\na y $-[0] 2
689'a$'m b\na y $-[0] 2
690aa\Z aa\nb\n n - -
691aa\z aa\nb\n n - -
692aa$ aa\nb\n n - -
693aa\Z b\naa\n y $-[0] 2
694aa\z b\naa\n n - -
695aa$ b\naa\n y $-[0] 2
696aa\Z b\naa y $-[0] 2
697aa\z b\naa y $-[0] 2
698aa$ b\naa y $-[0] 2
a1917ab9 699'aa\Z'm aa\nb\n n - -
cf93c79d
IZ
700'aa\z'm aa\nb\n n - -
701'aa$'m aa\nb\n y $-[0] 0
702'aa\Z'm b\naa\n y $-[0] 2
703'aa\z'm b\naa\n n - -
704'aa$'m b\naa\n y $-[0] 2
705'aa\Z'm b\naa y $-[0] 2
706'aa\z'm b\naa y $-[0] 2
707'aa$'m b\naa y $-[0] 2
708aa\Z ac\nb\n n - -
709aa\z ac\nb\n n - -
710aa$ ac\nb\n n - -
711aa\Z b\nac\n n - -
712aa\z b\nac\n n - -
713aa$ b\nac\n n - -
714aa\Z b\nac n - -
715aa\z b\nac n - -
716aa$ b\nac n - -
717'aa\Z'm ac\nb\n n - -
718'aa\z'm ac\nb\n n - -
719'aa$'m ac\nb\n n - -
720'aa\Z'm b\nac\n n - -
721'aa\z'm b\nac\n n - -
722'aa$'m b\nac\n n - -
723'aa\Z'm b\nac n - -
724'aa\z'm b\nac n - -
725'aa$'m b\nac n - -
726aa\Z ca\nb\n n - -
727aa\z ca\nb\n n - -
728aa$ ca\nb\n n - -
729aa\Z b\nca\n n - -
730aa\z b\nca\n n - -
731aa$ b\nca\n n - -
732aa\Z b\nca n - -
733aa\z b\nca n - -
734aa$ b\nca n - -
735'aa\Z'm ca\nb\n n - -
736'aa\z'm ca\nb\n n - -
737'aa$'m ca\nb\n n - -
738'aa\Z'm b\nca\n n - -
739'aa\z'm b\nca\n n - -
740'aa$'m b\nca\n n - -
741'aa\Z'm b\nca n - -
742'aa\z'm b\nca n - -
743'aa$'m b\nca n - -
744ab\Z ab\nb\n n - -
745ab\z ab\nb\n n - -
746ab$ ab\nb\n n - -
747ab\Z b\nab\n y $-[0] 2
748ab\z b\nab\n n - -
749ab$ b\nab\n y $-[0] 2
750ab\Z b\nab y $-[0] 2
751ab\z b\nab y $-[0] 2
752ab$ b\nab y $-[0] 2
a1917ab9 753'ab\Z'm ab\nb\n n - -
cf93c79d
IZ
754'ab\z'm ab\nb\n n - -
755'ab$'m ab\nb\n y $-[0] 0
756'ab\Z'm b\nab\n y $-[0] 2
757'ab\z'm b\nab\n n - -
758'ab$'m b\nab\n y $-[0] 2
759'ab\Z'm b\nab y $-[0] 2
760'ab\z'm b\nab y $-[0] 2
761'ab$'m b\nab y $-[0] 2
762ab\Z ac\nb\n n - -
763ab\z ac\nb\n n - -
764ab$ ac\nb\n n - -
765ab\Z b\nac\n n - -
766ab\z b\nac\n n - -
767ab$ b\nac\n n - -
768ab\Z b\nac n - -
769ab\z b\nac n - -
770ab$ b\nac n - -
771'ab\Z'm ac\nb\n n - -
772'ab\z'm ac\nb\n n - -
773'ab$'m ac\nb\n n - -
774'ab\Z'm b\nac\n n - -
775'ab\z'm b\nac\n n - -
776'ab$'m b\nac\n n - -
777'ab\Z'm b\nac n - -
778'ab\z'm b\nac n - -
779'ab$'m b\nac n - -
780ab\Z ca\nb\n n - -
781ab\z ca\nb\n n - -
782ab$ ca\nb\n n - -
783ab\Z b\nca\n n - -
784ab\z b\nca\n n - -
785ab$ b\nca\n n - -
786ab\Z b\nca n - -
787ab\z b\nca n - -
788ab$ b\nca n - -
789'ab\Z'm ca\nb\n n - -
790'ab\z'm ca\nb\n n - -
791'ab$'m ca\nb\n n - -
792'ab\Z'm b\nca\n n - -
793'ab\z'm b\nca\n n - -
794'ab$'m b\nca\n n - -
795'ab\Z'm b\nca n - -
796'ab\z'm b\nca n - -
797'ab$'m b\nca n - -
798abb\Z abb\nb\n n - -
799abb\z abb\nb\n n - -
800abb$ abb\nb\n n - -
801abb\Z b\nabb\n y $-[0] 2
802abb\z b\nabb\n n - -
803abb$ b\nabb\n y $-[0] 2
804abb\Z b\nabb y $-[0] 2
805abb\z b\nabb y $-[0] 2
806abb$ b\nabb y $-[0] 2
a1917ab9 807'abb\Z'm abb\nb\n n - -
cf93c79d
IZ
808'abb\z'm abb\nb\n n - -
809'abb$'m abb\nb\n y $-[0] 0
810'abb\Z'm b\nabb\n y $-[0] 2
811'abb\z'm b\nabb\n n - -
812'abb$'m b\nabb\n y $-[0] 2
813'abb\Z'm b\nabb y $-[0] 2
814'abb\z'm b\nabb y $-[0] 2
815'abb$'m b\nabb y $-[0] 2
816abb\Z ac\nb\n n - -
817abb\z ac\nb\n n - -
818abb$ ac\nb\n n - -
819abb\Z b\nac\n n - -
820abb\z b\nac\n n - -
821abb$ b\nac\n n - -
822abb\Z b\nac n - -
823abb\z b\nac n - -
824abb$ b\nac n - -
825'abb\Z'm ac\nb\n n - -
826'abb\z'm ac\nb\n n - -
827'abb$'m ac\nb\n n - -
828'abb\Z'm b\nac\n n - -
829'abb\z'm b\nac\n n - -
830'abb$'m b\nac\n n - -
831'abb\Z'm b\nac n - -
832'abb\z'm b\nac n - -
833'abb$'m b\nac n - -
834abb\Z ca\nb\n n - -
835abb\z ca\nb\n n - -
836abb$ ca\nb\n n - -
837abb\Z b\nca\n n - -
838abb\z b\nca\n n - -
839abb$ b\nca\n n - -
840abb\Z b\nca n - -
841abb\z b\nca n - -
842abb$ b\nca n - -
843'abb\Z'm ca\nb\n n - -
844'abb\z'm ca\nb\n n - -
845'abb$'m ca\nb\n n - -
846'abb\Z'm b\nca\n n - -
847'abb\z'm b\nca\n n - -
848'abb$'m b\nca\n n - -
849'abb\Z'm b\nca n - -
850'abb\z'm b\nca n - -
851'abb$'m b\nca n - -
fad493ef 852'\Aa$'m a\n\n y $& a
8e680dc3 853(^|x)(c) ca y $2 c
aca2d497 854a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz x n - -
94c1d7aa 855a(?{$a=2;$b=3;($b)=$a})b yabz y $b 2
9fe1d20c 856round\(((?>[^()]+))\) _I(round(xs * sz),1) y $1 xs * sz
ce3e6498
HS
857'((?x:.) )' x y $1- x -
858'((?-x:.) )'x x y $1- x-
adac82c7 859foo.bart foo.bart y - -
2c2d71f5
JH
860'^d[x][x][x]'m abcd\ndxxx y - -
861.X(.+)+X bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
862.X(.+)+XX bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
863.XX(.+)+X bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
864.X(.+)+X bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
865.X(.+)+XX bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
866.XX(.+)+X bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
867.X(.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
868.X(.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
869.XX(.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
870.X(.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
871.X(.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
872.XX(.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
873.[X](.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
874.[X](.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
875.[X][X](.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
876.[X](.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
877.[X](.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
878.[X][X](.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
879tt+$ xxxtt y - -
1209ba90 880([a-\d]+) za-9z y $1 a-9
1209ba90 881([\d-z]+) a0-za y $1 0-z
73b437c8 882([\d-\s]+) a0- z y $1 0-
1209ba90 883([a-[:digit:]]+) za-9z y $1 a-9
1209ba90 884([[:digit:]-z]+) =0-z= y $1 0-z
73b437c8 885([[:digit:]-[:alpha:]]+) =0-z= y $1 0-z
30382c73 886\GX.*X aaaXbX n - -
6eb5f6b9
JH
887(\d+\.\d+) 3.1415926 y $1 3.1415926
888(\ba.{0,10}br) have a web browser y $1 a web br
66e933ab
GS
889'\.c(pp|xx|c)?$'i Changes n - -
890'\.c(pp|xx|c)?$'i IO.c y - -
891'(\.c(pp|xx|c)?$)'i IO.c y $1 .c
653099ff 892^([a-z]:) C:/ n - -
60e71179 893'^\S\s+aa$'m \nx aa y - -
de0c8cb8 894(^|a)b ab y - -
f06a1d4e 895^([ab]*?)(b)?(c)$ abac y -$2- --
29d1e993 896(\w)?(abc)\1b abcab n - -
2a8d9689
HS
897^(?:.,){2}c a,b,c y - -
898^(.,){2}c a,b,c y $1 b,
899^(?:[^,]*,){2}c a,b,c y - -
900^([^,]*,){2}c a,b,c y $1 b,
4b2cff9a
HS
901^([^,]*,){3}d aaa,b,c,d y $1 c,
902^([^,]*,){3,}d aaa,b,c,d y $1 c,
903^([^,]*,){0,3}d aaa,b,c,d y $1 c,
904^([^,]{1,3},){3}d aaa,b,c,d y $1 c,
905^([^,]{1,3},){3,}d aaa,b,c,d y $1 c,
906^([^,]{1,3},){0,3}d aaa,b,c,d y $1 c,
907^([^,]{1,},){3}d aaa,b,c,d y $1 c,
908^([^,]{1,},){3,}d aaa,b,c,d y $1 c,
909^([^,]{1,},){0,3}d aaa,b,c,d y $1 c,
910^([^,]{0,3},){3}d aaa,b,c,d y $1 c,
911^([^,]{0,3},){3,}d aaa,b,c,d y $1 c,
912^([^,]{0,3},){0,3}d aaa,b,c,d y $1 c,
bf93d4cc 913(?i) y - -
cfaf538b 914(?a:((?u)\w)\W) \xC0\xC0 y $& \xC0\xC0
c2a73568 915'(?!\A)x'm a\nxb\n y - -
c1d44abf
JH
916^(a(b)?)+$ aba y -$1-$2- -a--
917^(aa(bb)?)+$ aabbaa y -$1-$2- -aa--
0e41cd87 918'^.{9}abc.*\n'm 123\nabcabcabcabc\n y - -
66417f84
HS
919^(a)?a$ a y -$1- --
920^(a)?(?(1)a|b)+$ a n - -
cb434fcc
IZ
921^(a\1?)(a\1?)(a\2?)(a\3?)$ aaaaaa y $1,$2,$3,$4 a,aa,a,aa
922^(a\1?){4}$ aaaaaa y $1 aa
923^(0+)?(?:x(1))? x1 y - -
924^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))? 012cxx0190 y - -
e1901655
IZ
925^(b+?|a){1,2}c bbbac y $1 a
926^(b+?|a){1,2}c bbbbac y $1 a
2e36c929 927\((\w\. \w+)\) cd. (A. Tw) y -$1- -A. Tw-
f49d4d0f
HS
928((?:aaaa|bbbb)cccc)? aaaacccc y - -
929((?:aaaa|bbbb)cccc)? bbbbcccc y - -
36670241
JH
930(a)?(a)+ a y $1:$2 :a -
931(ab)?(ab)+ ab y $1:$2 :ab -
932(abc)?(abc)+ abc y $1:$2 :abc -
12d33761 933'b\s^'m a\nb\n n - -
ee0b7718 934\ba a y - -
61525e55 935^(a(??{"(?!)"})|(a)(?{1}))b ab y $2 a # [ID 20010811.006]
055bb491
HS
936ab(?i)cd AbCd n - - # [ID 20010809.023]
937ab(?i)cd abCd y - -
f31a99c8
HS
938(A|B)*(?(1)(CD)|(CD)) CD y $2-$3 -CD
939(A|B)*(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
940(A|B)*?(?(1)(CD)|(CD)) CD y $2-$3 -CD # [ID 20010803.016]
941(A|B)*?(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
f65d3ee7 942'^(o)(?!.*\1)'i Oo n - -
24ba5a3c 943(.*)\d+\1 abc12bc y $1 bc
1ac24cf0 944(?m:(foo\s*$)) foo\n bar y $1 foo
a84d97b6
HS
945(.*)c abcd y $1 ab
946(.*)(?=c) abcd y $1 ab
947(.*)(?=c)c abcd yB $1 ab
948(.*)(?=b|c) abcd y $1 ab
949(.*)(?=b|c)c abcd y $1 ab
950(.*)(?=c|b) abcd y $1 ab
951(.*)(?=c|b)c abcd y $1 ab
952(.*)(?=[bc]) abcd y $1 ab
953(.*)(?=[bc])c abcd yB $1 ab
954(.*)(?<=b) abcd y $1 ab
955(.*)(?<=b)c abcd y $1 ab
956(.*)(?<=b|c) abcd y $1 abc
957(.*)(?<=b|c)c abcd y $1 ab
958(.*)(?<=c|b) abcd y $1 abc
959(.*)(?<=c|b)c abcd y $1 ab
960(.*)(?<=[bc]) abcd y $1 abc
961(.*)(?<=[bc])c abcd y $1 ab
962(.*?)c abcd y $1 ab
963(.*?)(?=c) abcd y $1 ab
964(.*?)(?=c)c abcd yB $1 ab
965(.*?)(?=b|c) abcd y $1 a
966(.*?)(?=b|c)c abcd y $1 ab
967(.*?)(?=c|b) abcd y $1 a
968(.*?)(?=c|b)c abcd y $1 ab
969(.*?)(?=[bc]) abcd y $1 a
970(.*?)(?=[bc])c abcd yB $1 ab
971(.*?)(?<=b) abcd y $1 ab
972(.*?)(?<=b)c abcd y $1 ab
973(.*?)(?<=b|c) abcd y $1 ab
974(.*?)(?<=b|c)c abcd y $1 ab
975(.*?)(?<=c|b) abcd y $1 ab
976(.*?)(?<=c|b)c abcd y $1 ab
977(.*?)(?<=[bc]) abcd y $1 ab
978(.*?)(?<=[bc])c abcd y $1 ab
d3aea5f7 9792(]*)?$\1 2 y $& 2
61525e55 980(??{}) x y - -
ecc99935 981a(b)?? abc y <$1> <> # undef [perl #16773]
c152dc43 982(\d{1,3}\.){3,} 128.134.142.8 y <$1> <142.> # [perl #18019]
b0e70d55
HS
983^.{3,4}(.+)\1\z foobarbar y $1 bar # 16 tests for [perl #23171]
984^(?:f|o|b){3,4}(.+)\1\z foobarbar y $1 bar
985^.{3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
986^(?:f|o|b){3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
987^.{3,4}(.+?)\1\z foobarbar y $1 bar
988^(?:f|o|b){3,4}(.+?)\1\z foobarbar y $1 bar
989^.{3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
990^(?:f|o|b){3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
991^.{2,3}?(.+)\1\z foobarbar y $1 bar
992^(?:f|o|b){2,3}?(.+)\1\z foobarbar y $1 bar
993^.{2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
994^(?:f|o|b){2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
995^.{2,3}?(.+?)\1\z foobarbar y $1 bar
996^(?:f|o|b){2,3}?(.+?)\1\z foobarbar y $1 bar
997^.{2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
998^(?:f|o|b){2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
c2b0868c 999.*a(?!(b|cd)*e).*f ......abef n - - # [perl #23030]
e994fd66
AE
1000x(?# x c - Sequence (?#... not terminated
1001:x(?#: x c - Sequence (?#... not terminated
a3621e74
YO
1002(WORDS|WORD)S WORDS y $1 WORD
1003(X.|WORDS|X.|WORD)S WORDS y $1 WORD
1004(WORDS|WORLD|WORD)S WORDS y $1 WORD
1005(X.|WORDS|WORD|Y.)S WORDS y $1 WORD
1006(foo|fool|x.|money|parted)$ fool y $1 fool
1007(x.|foo|fool|x.|money|parted|y.)$ fool y $1 fool
1008(foo|fool|money|parted)$ fool y $1 fool
1009(foo|fool|x.|money|parted)$ fools n - -
1010(x.|foo|fool|x.|money|parted|y.)$ fools n - -
1011(foo|fool|money|parted)$ fools n - -
3dab1dad 1012(a|aa|aaa||aaaa|aaaaa|aaaaaa)(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
61525e55
NC
1013(a|aa|aaa||aaaa|aaaaa|aaaaaa)(??{$1&&""})(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
1014(a|aa|aaa|aaaa|aaaaa|aaaaaa)(??{$1&&"foo"})(b|c) aaaaaaaaaaaaaaab n - -
3ab3c9b4
HS
1015^(a*?)(?!(aa|aaaa)*$) aaaaaaaaaaaaaaaaaaaa y $1 a # [perl #34195]
1016^(a*?)(?!(aa|aaaa)*$)(?=a\z) aaaaaaaa y $1 aaaaaaa
c315bfe8 1017^(.)\s+.$(?(1)) A B y $1 A # [perl #37688]
3a2830be
A
1018(?:r?)*?r|(.{2,4}) abcde y $1 abcd
1019(?!)+?|(.{2,4}) abcde y $1 abcd
7409bbd3 1020^(a*?)(?!(a{6}|a{5})*$) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y $+[1] 12 # super-linear cache bug may return 18
dad79028
DM
1021^((?>(?:aa)?b)?) aab y $1 aab
1022^((?:aa)*)(?:X+((?:\d+|-)(?:X+(.+))?))?$ aaaaX5 y $1 aaaa
3dab1dad
YO
1023X(A|B||C|D)Y XXXYYY y $& XY # Trie w/ NOTHING
1024(?i:X([A]|[B]|y[Y]y|[D]|)Y) XXXYYYB y $& XY # Trie w/ NOTHING
40a82448 1025^([a]{1})*$ aa y $1 a
3298f257
DM
1026a(?!b(?!c))(..) abababc y $1 bc # test nested negatives
1027a(?!b(?=a))(..) abababc y $1 bc # test nested lookaheads
1028a(?!b(?!c(?!d(?!e))))...(.) abxabcdxabcde y $1 e
1029X(?!b+(?!(c+)*(?!(c+)*d))).*X aXbbbbbbbcccccccccccccaaaX y - -
786e8c11
YO
1030^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1031^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1032^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1033^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1034^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1035^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1036^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1037^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1038^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1039^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1040^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1041^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1042X(?:ABCF[cC]x*|ABCD|ABCF):(?:DIT|DID|DIM) XABCFCxxxxxxxxxx:DIM y $& XABCFCxxxxxxxxxx:DIM
1043(((ABCD|ABCE|ABCF)))(A|B|C[xy]*): ABCFCxxxxxxxxxx:DIM y $& ABCFCxxxxxxxxxx:
1de06328
YO
1044(?=foo) foo y pos 0
1045(?=foo) XfooY y pos 1
1046.*(?=foo) XfooY y pos 1
1047(?<=foo) foo y pos 3
1048(?<=foo) XfooY y pos 4
1049.*(?<=foo) foo y pos 3
1050.*(?<=foo) XfooY y pos 4
1051(?<=foo)Y XfooY y pos 5
1052o(?<=foo)Y ..XfooY.. y pos 7
1053X(?=foo)f ..XfooY.. y pos 4
1054X(?=foo) ..XfooY.. y pos 3
1055X(?<=foo.)[YZ] ..XfooXY.. y pos 8
1056(?=XY*foo) Xfoo y pos 0
1057^(?=XY*foo) Xfoo y pos 0
61525e55
NC
1058^(??{"a+"})a aa y $& aa
1059^(?:(??{"a+"})|b)a aa y $& aa
1060^(??{chr 0x100}).$ \x{100}\x{100} y $& \x{100}\x{100}
1061^(??{q(\x{100})}). \x{100}\x{100} y $& \x{100}\x{100}
1062^(??{q(.+)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1063^(??{q(.)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1064^(??{chr 0x100})\xbb \x{100}\x{bb} y $& \x{100}\x{bb}
1065^(.)(??{"(.)(.)"})(.)$ abcd y $1-$2 a-d
1066^(.)(??{"(bz+|.)(.)"})(.)$ abcd y $1-$2 a-d
1067^(.)((??{"(.)(cz+)"})|.) abcd y $1-$2 a-b
1068^a(?>(??{q(b)}))(??{q(c)})d abcd y - -
1069^x(??{""})+$ x y $& x
6bda09f9
YO
1070^(<(?:[^<>]+|(?3)|(?1))*>)()(!>!>!>)$ <<!>!>!>><>>!>!>!> y $1 <<!>!>!>><>>
1071^(<(?:[^<>]+|(?1))*>)$ <<><<<><>>>> y $1 <<><<<><>>>>
1072((?2)*)([fF]o+) fooFoFoo y $1-$2 fooFo-Foo
1073(<(?:[^<>]+|(?R))*>) <<><<<><>>>> y $1 <<><<<><>>>>
81714fb9 1074(?<n>foo|bar|baz) snofooewa y $1 foo
cb6fa888
NC
1075(?<n>foo|bar|baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1076(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1077(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1078(?<n>foo)|(?<n>bar)|(?<n>baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1079(?<n>foo)(??{ $+{n} }) snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe 1080(?P<n>foo|bar|baz) snofooewa y $1 foo
cb6fa888
NC
1081(?P<n>foo|bar|baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1082(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1083(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1084(?P<n>foo)|(?P<n>bar)|(?P<n>baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1085(?P<n>foo)(??{ $+{n} }) snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f4f6bf1
YO
1086(?P<=n>foo|bar|baz) snofooewa c - Group name must start with a non-digit word character
1087(?P<!n>foo|bar|baz) snofooewa c - Group name must start with a non-digit word character
1f1031fe 1088(?PX<n>foo|bar|baz) snofooewa c - Sequence (?PX<...) not recognized
81714fb9 1089/(?'n'foo|bar|baz)/ snofooewa y $1 foo
cb6fa888
NC
1090/(?'n'foo|bar|baz)/ snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1091/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1092/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1093/(?'n'foo)|(?'n'bar)|(?<n>baz)/ snobazewa yM $+{n} baz miniperl cannot load Tie::Hash::NamedCapture
1094/(?'n'foo)(??{ $+{n} })/ snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
81714fb9 1095/(?'n'foo)\k<n>/ ..foofoo.. y $1 foo
cb6fa888 1096/(?'n'foo)\k<n>/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
81714fb9 1097/(?<n>foo)\k'n'/ ..foofoo.. y $1 foo
cb6fa888
NC
1098/(?<n>foo)\k'n'/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1099/(?:(?<n>foo)|(?<n>bar))\k<n>/ ..barbar.. yM $+{n} bar miniperl cannot load Tie::Hash::NamedCapture
1100/^(?'main'<(?:[^<>]+|(?&crap)|(?&main))*>)(?'empty')(?'crap'!>!>!>)$/ <<!>!>!>><>>!>!>!> yM $+{main} <<!>!>!>><>> miniperl cannot load Tie::Hash::NamedCapture
894be9b7 1101/^(?'main'<(?:[^<>]+|(?&main))*>)$/ <<><<<><>>>> y $1 <<><<<><>>>>
cb6fa888
NC
1102/(?'first'(?&second)*)(?'second'[fF]o+)/ fooFoFoo yM $+{first}-$+{second} fooFo-Foo miniperl cannot load Tie::Hash::NamedCapture
1103(?<A>foo)?(?(<A>)bar|nada) foobar yM $+{A} foo miniperl cannot load Tie::Hash::NamedCapture
0a4db386
YO
1104(?<A>foo)?(?(<A>)bar|nada) foo-barnada y $& nada
1105(?<A>foo)?(?(1)bar|nada) foo-barnada y $& nada
1106(?<A>foo(?(R)bar))?(?1) foofoobar y $1 foo
1107(?<A>foo(?(R)bar))?(?1) foofoobar y $& foofoobar
1108(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $2 foo
1109(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $& xfoofoobar
1110(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $2 foo
1111(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $& xfoofoobar
1112(?1)(?(DEFINE)(blah)) blah y $& blah
1113/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamimadam y $& madamimadam
1114/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamiamadam n - -
1115/(a)?((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1116/(a)*((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1117/(a)+((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1118/(a){1,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1119/(a){0,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1120/(ab)?((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1121/(ab)*((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1122/(ab)+((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1123/(ab){1,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1124/(ab){0,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
b9b4dddf
YO
1125# possessive captures
1126a++a aaaaa n - -
1127a*+a aaaaa n - -
1128a{1,5}+a aaaaa n - -
1129a?+a ab n - -
1130a++b aaaaab y $& aaaaab
1131a*+b aaaaab y $& aaaaab
1132a{1,5}+b aaaaab y $& aaaaab
1133a?+b ab y $& ab
1134fooa++a fooaaaaa n - -
1135fooa*+a fooaaaaa n - -
1136fooa{1,5}+a fooaaaaa n - -
1137fooa?+a fooab n - -
1138fooa++b fooaaaaab y $& fooaaaaab
1139fooa*+b fooaaaaab y $& fooaaaaab
1140fooa{1,5}+b fooaaaaab y $& fooaaaaab
1141fooa?+b fooab y $& fooab
1142(?:aA)++(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1143(aA)++(aA) aAaAaAaAaA n - aAaAaAaAaA
1144(aA|bB)++(aA|bB) aAaAbBaAbB n - aAaAbBaAbB
1145(?:aA|bB)++(?:aA|bB) aAbBbBbBaA n - aAbBbBbBaA
1146(?:aA)*+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1147(aA)*+(aA) aAaAaAaAaA n - aAaAaAaAaA
1148(aA|bB)*+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1149(?:aA|bB)*+(?:aA|bB) aAaAaAbBaA n - aAaAaAbBaA
1150(?:aA){1,5}+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1151(aA){1,5}+(aA) aAaAaAaAaA n - aAaAaAaAaA
1152(aA|bB){1,5}+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1153(?:aA|bB){1,5}+(?:aA|bB) bBbBbBbBbB n - bBbBbBbBbB
1154(?:aA)?+(?:aA) aAb n - aAb
1155(aA)?+(aA) aAb n - aAb
1156(aA|bB)?+(aA|bB) bBb n - bBb
1157(?:aA|bB)?+(?:aA|bB) aAb n - aAb
1158(?:aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1159(aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1160(aA|bB)++b aAbBaAaAbBb y $& aAbBaAaAbBb
1161(?:aA|bB)++b aAbBbBaAaAb y $& aAbBbBaAaAb
1162(?:aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1163(aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1164(aA|bB)*+b bBbBbBbBbBb y $& bBbBbBbBbBb
1165(?:aA|bB)*+b bBaAbBbBaAb y $& bBaAbBbBaAb
1166(?:aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1167(aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1168(aA|bB){1,5}+b bBaAbBaAbBb y $& bBaAbBaAbBb
1169(?:aA|bB){1,5}+b aAbBaAbBbBb y $& aAbBaAbBbBb
1170(?:aA)?+b aAb y $& aAb
1171(aA)?+b aAb y $& aAb
1172(aA|bB)?+b bBb y $& bBb
1173(?:aA|bB)?+b bBb y $& bBb
1174foo(?:aA)++(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1175foo(aA)++(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1176foo(aA|bB)++(aA|bB) foobBbBbBaAaA n - foobBbBbBaAaA
1177foo(?:aA|bB)++(?:aA|bB) fooaAaAaAaAaA n - fooaAaAaAaAaA
1178foo(?:aA)*+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1179foo(aA)*+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1180foo(aA|bB)*+(aA|bB) foobBaAbBaAaA n - foobBaAbBaAaA
1181foo(?:aA|bB)*+(?:aA|bB) fooaAaAbBbBaA n - fooaAaAbBbBaA
1182foo(?:aA){1,5}+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1183foo(aA){1,5}+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1184foo(aA|bB){1,5}+(aA|bB) fooaAbBbBaAaA n - fooaAbBbBaAaA
1185foo(?:aA|bB){1,5}+(?:aA|bB) fooaAbBbBaAbB n - fooaAbBbBaAbB
1186foo(?:aA)?+(?:aA) fooaAb n - fooaAb
1187foo(aA)?+(aA) fooaAb n - fooaAb
1188foo(aA|bB)?+(aA|bB) foobBb n - foobBb
1189foo(?:aA|bB)?+(?:aA|bB) fooaAb n - fooaAb
1190foo(?:aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1191foo(aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1192foo(aA|bB)++b foobBaAbBaAbBb y $& foobBaAbBaAbBb
1193foo(?:aA|bB)++b fooaAaAbBaAaAb y $& fooaAaAbBaAaAb
1194foo(?:aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1195foo(aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1196foo(aA|bB)*+b foobBbBaAaAaAb y $& foobBbBaAaAaAb
1197foo(?:aA|bB)*+b foobBaAaAbBaAb y $& foobBaAaAbBaAb
1198foo(?:aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1199foo(aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1200foo(aA|bB){1,5}+b foobBaAaAaAaAb y $& foobBaAaAaAaAb
1201foo(?:aA|bB){1,5}+b fooaAbBaAbBbBb y $& fooaAbBaAbBbBb
1202foo(?:aA)?+b fooaAb y $& fooaAb
1203foo(aA)?+b fooaAb y $& fooaAb
1204foo(aA|bB)?+b foobBb y $& foobBb
1205foo(?:aA|bB)?+b foobBb y $& foobBb
1206
1207([^()]++|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
1208round\(([^()]++)\) _I(round(xs * sz),1) y $1 xs * sz
1209
7f69552c
YO
1210(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $1 baz3
1211(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $& foo1bar2baz3y
1212(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $1 baz3
1213(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $& foo1bar2baz3y
1214
1215([yX].|WORDS|[yX].|WORD)S WORDS y $1 WORD
1216(WORDS|WORLD|WORD)S WORDS y $1 WORD
1217([yX].|WORDS|WORD|[xY].)S WORDS y $1 WORD
1218(foo|fool|[zx].|money|parted)$ fool y $1 fool
1219([zx].|foo|fool|[zq].|money|parted|[yx].)$ fool y $1 fool
1220(foo|fool|[zx].|money|parted)$ fools n - -
1221([zx].|foo|fool|[qx].|money|parted|[py].)$ fools n - -
1222
1223([yX].|WORDS|[yX].|WORD)+S WORDS y $1 WORD
1224(WORDS|WORLD|WORD)+S WORDS y $1 WORD
1225([yX].|WORDS|WORD|[xY].)+S WORDS y $1 WORD
1226(foo|fool|[zx].|money|parted)+$ fool y $1 fool
1227([zx].|foo|fool|[zq].|money|parted|[yx].)+$ fool y $1 fool
1228(foo|fool|[zx].|money|parted)+$ fools n - -
1229([zx].|foo|fool|[qx].|money|parted|[py].)+$ fools n - -
1230
1231(x|y|z[QW])+(longish|loquatious|excessive|overblown[QW])+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1232(x|y|z[QW])*(longish|loquatious|excessive|overblown[QW])* xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1233(x|y|z[QW]){1,5}(longish|loquatious|excessive|overblown[QW]){1,5} xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1234
1235(x|y|z[QW])++(longish|loquatious|excessive|overblown[QW])++ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1236(x|y|z[QW])*+(longish|loquatious|excessive|overblown[QW])*+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1237(x|y|z[QW]){1,5}+(longish|loquatious|excessive|overblown[QW]){1,5}+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1238
7f69552c 1239a*(?!) aaaab n - -
e2e6a0f1
YO
1240a*(*FAIL) aaaab n - -
1241a*(*F) aaaab n - -
1242
1243(A(A|B(*ACCEPT)|C)D)(E) AB y $1 AB
1244(A(A|B(*ACCEPT)|C)D)(E) ACDE y $1$2$3 ACDCE
1245
542fa716 1246(a)(?:(?-1)|(?+1))(b) aab y $&-$1-$2 aab-a-b
c74340f9 1247(a)(?:(?-1)|(?+1))(b) abb y $1-$2 a-b
542fa716 1248(a)(?:(?-1)|(?+1))(b) acb n - -
c74340f9 1249
2bf803e2
YO
1250(foo)(\g-2) foofoo y $1-$2 foo-foo
1251(foo)(\g-2)(foo)(\g-2) foofoofoofoo y $1-$2-$3-$4 foo-foo-foo-foo
1252(([abc]+) \g-1)(([abc]+) \g{-1}) abc abccba cba y $2-$4 abc-cba
1253(a)(b)(c)\g1\g2\g3 abcabc y $1$2$3 abc
1254
1f1031fe 1255# \k<n> preceded by a literal
99ed40ff 1256/(?'n'foo) \k<n>/ ..foo foo.. y $1 foo
cb6fa888 1257/(?'n'foo) \k<n>/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
99ed40ff 1258/(?<n>foo) \k'n'/ ..foo foo.. y $1 foo
cb6fa888
NC
1259/(?<n>foo) \k'n'/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1260/(?'a1'foo) \k'a1'/ ..foo foo.. yM $+{a1} foo miniperl cannot load Tie::Hash::NamedCapture
1261/(?<a1>foo) \k<a1>/ ..foo foo.. yM $+{a1} foo miniperl cannot load Tie::Hash::NamedCapture
1262/(?'_'foo) \k'_'/ ..foo foo.. yM $+{_} foo miniperl cannot load Tie::Hash::NamedCapture
1263/(?<_>foo) \k<_>/ ..foo foo.. yM $+{_} foo miniperl cannot load Tie::Hash::NamedCapture
1264/(?'_0_'foo) \k'_0_'/ ..foo foo.. yM $+{_0_} foo miniperl cannot load Tie::Hash::NamedCapture
1265/(?<_0_>foo) \k<_0_>/ ..foo foo.. yM $+{_0_} foo miniperl cannot load Tie::Hash::NamedCapture
1f4f6bf1
YO
1266/(?'0'foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1267/(?<0>foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1268/(?'12'foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1269/(?<12>foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1270/(?'1a'foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1271/(?<1a>foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1272/(?''foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1273/(?<>foo) bar/ ..foo bar.. c - Group name must start with a non-digit word character
1f1031fe
YO
1274/foo \k'n'/ foo foo c - Reference to nonexistent named group
1275/foo \k<n>/ foo foo c - Reference to nonexistent named group
1276/foo \k'a1'/ foo foo c - Reference to nonexistent named group
1277/foo \k<a1>/ foo foo c - Reference to nonexistent named group
1278/foo \k'_'/ foo foo c - Reference to nonexistent named group
1279/foo \k<_>/ foo foo c - Reference to nonexistent named group
1280/foo \k'_0_'/ foo foo c - Reference to nonexistent named group
1281/foo \k<_0_>/ foo foo c - Reference to nonexistent named group
1f4f6bf1
YO
1282/foo \k'0'/ foo foo c - Group name must start with a non-digit word character
1283/foo \k<0>/ foo foo c - Group name must start with a non-digit word character
1284/foo \k'12'/ foo foo c - Group name must start with a non-digit word character
1285/foo \k<12>/ foo foo c - Group name must start with a non-digit word character
1286/foo \k'1a'/ foo foo c - Group name must start with a non-digit word character
1287/foo \k<1a>/ foo foo c - Group name must start with a non-digit word character
1288/foo \k''/ foo foo c - Group name must start with a non-digit word character
1289/foo \k<>/ foo foo c - Group name must start with a non-digit word character
99ed40ff 1290/(?<as>as) (\w+) \k<as> (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1f1031fe
YO
1291
1292# \g{...} with a name as the argument
1293/(?'n'foo) \g{n}/ ..foo foo.. y $1 foo
cb6fa888 1294/(?'n'foo) \g{n}/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe 1295/(?<n>foo) \g{n}/ ..foo foo.. y $1 foo
cb6fa888 1296/(?<n>foo) \g{n}/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1297/(?<as>as) (\w+) \g{as} (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1298
1299# Python style named capture buffer stuff
1300/(?P<n>foo)(?P=n)/ ..foofoo.. y $1 foo
cb6fa888
NC
1301/(?P<n>foo)(?P=n)/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1302/(?:(?P<n>foo)|(?P<n>bar))(?P=n)/ ..barbar.. yM $+{n} bar miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1303/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamimadam y $& madamimadam
1304/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamiamadam n - -
1305/(?P<n>foo) (?P=n)/ ..foo foo.. y $1 foo
cb6fa888 1306/(?P<n>foo) (?P=n)/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1307/(?P<as>as) (\w+) (?P=as) (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1308
1309#check that non identifiers as names are treated as the appropriate lookaround
1310(?<=bar>)foo bar>foo y $& foo
1311(?<!bar>)foo bar>foo n - -
1312(?<=bar>ABC)foo bar>ABCfoo y $& foo
1313(?<!bar>ABC)foo bar>ABCfoo n - -
1314(?<bar>)foo bar>ABCfoo y $& foo
68ba3a3f
YO
1315(?<bar>ABC)foo bar>ABCfoo y $& ABCfoo
1316
1317(?<=abcd(?<=(aaaabcd))) ..aaaabcd.. y $1 aaaabcd
1318(?=xy(?<=(aaxy))) ..aaxy.. y $1 aaxy
fae667d5
YO
1319
1320X(\w+)(?=\s)|X(\w+) Xab y [$1-$2] [-ab]
594d7033
YO
1321
1322#check that branch reset works ok.
3bce0506 1323(?|(a)) a y $1-$+-$^N a-a-a
594d7033
YO
1324(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) d!o!da y $1-$2-$3 !o!-o-a
1325(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) aabc y $1-$2-$3 a--c
1326(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) ixyjp y $1-$2-$3 x-y-p
1327(?|(?|(a)|(b))|(?|(c)|(d))) a y $1 a
1328(?|(?|(a)|(b))|(?|(c)|(d))) b y $1 b
1329(?|(?|(a)|(b))|(?|(c)|(d))) c y $1 c
1330(?|(?|(a)|(b))|(?|(c)|(d))) d y $1 d
1331(.)(?|(.)(.)x|(.)d)(.) abcde y $1-$2-$3-$4-$5- b-c--e--
cbf4a129 1332(\N)(?|(\N)(\N)x|(\N)d)(\N) abcde y $1-$2-$3-$4-$5- b-c--e--
cb6fa888
NC
1333(?|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1334(?|(?<foo>x)|(?<bar>y)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1335(?|(?<bar>y)|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1336(?<bar>)(?|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
fd4be6f0
FC
1337# Used to crash, because the last branch was ignored when the parens
1338# were counted:
1339(?|(b)|()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(a)) a y $& a
ee91d26e 1340
3e901dc0
YO
1341#Bug #41492
1342(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) a y $& a
1343(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) aa y $& aa
61525e55 1344\x{100}?(??{""})xxx xxx y $& xxx
e1d1eefb
YO
1345
1346foo(\R)bar foo\r\nbar y $1 \r\n
1347foo(\R)bar foo\nbar y $1 \n
1348foo(\R)bar foo\rbar y $1 \r
1349
1350foo(\R+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1351(\V+)(\R) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r\n
1352(\R+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1353foo(\R)bar foo\x{85}bar y $1 \x{85}
1354(\V)(\R) foo\x{85}bar y $1-$2 o-\x{85}
1355(\R)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1356foo(\R)bar foo\r\nbar y $1 \r\n
1357(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1358(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1359foo(\R)bar foo\r\nbar y $1 \r\n
1360(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1361(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1362foo(\R)bar foo\rbar y $1 \r
1363(\V)(\R) foo\rbar y $1-$2 o-\r
1364(\R)(\V) foo\rbar y $1-$2 \r-b
1365
1366foo(\v+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1367(\V+)(\v) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r
1368(\v+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1369foo(\v)bar foo\x{85}bar y $1 \x{85}
1370(\V)(\v) foo\x{85}bar y $1-$2 o-\x{85}
1371(\v)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1372foo(\v)bar foo\rbar y $1 \r
1373(\V)(\v) foo\rbar y $1-$2 o-\r
1374(\v)(\V) foo\rbar y $1-$2 \r-b
1375
1376
1377foo(\h+)bar foo\t\x{A0}bar y $1 \t\x{A0}
1378(\H+)(\h) foo\t\x{A0}bar y $1-$2 foo-\t
1379(\h+)(\H) foo\t\x{A0}bar y $1-$2 \t\x{A0}-b
1380foo(\h)bar foo\x{A0}bar y $1 \x{A0}
1381(\H)(\h) foo\x{A0}bar y $1-$2 o-\x{A0}
1382(\h)(\H) foo\x{A0}bar y $1-$2 \x{A0}-b
1383foo(\h)bar foo\tbar y $1 \t
1384(\H)(\h) foo\tbar y $1-$2 o-\t
1385(\h)(\H) foo\tbar y $1-$2 \t-b
5339e136 1386
cbf4a129
RGS
1387.*\z foo\n y -$&- --
1388\N*\z foo\n y -$&- --
1389.*\Z foo\n y -$&- -foo-
1390\N*\Z foo\n y -$&- -foo-
225593e1 1391^(?:(\d)x)?\d$ 1 y ${\(defined($1)?1:0)} 0
60f65011 1392.*?(?:(\w)|(\w))x abx y $1-$2 b-
639081d6
YO
1393
13940{50} 000000000000000000000000000000000000000000000000000 y - -
906cdd2b
HS
1395^a?(?=b)b ab y $& ab # Bug #56690
1396^a*(?=b)b ab y $& ab # Bug #56690
2811b836
B
1397/>\d+$ \n/ix >10\n y $& >10
1398/>\d+$ \n/ix >1\n y $& >1
1399/\d+$ \n/ix >10\n y $& 10
1400/>\d\d$ \n/ix >10\n y $& >10
1401/>\d+$ \n/x >10\n y $& >10
44d268c3
NC
1402
1403# Two regressions in 5.8.x (only) introduced by change 30638
1404# Simplification of the test failure in XML::LibXML::Simple:
1405/^\s*i.*?o\s*$/s io\n io y - -
1406# As reported in #59168 by Father Chrysostomos:
1407/(.*?)a(?!(a+)b\2c)/ baaabaac y $&-$1 baa-ba
aff3edb5
YO
1408# [perl #60344] Regex lookbehind failure after an (if)then|else in perl 5.10
1409/\A(?(?=db2)db2|\D+)(?<!processed)\.csv\z/xms sql_processed.csv n - -
24d786f4 1410/\N{U+0100}/ \x{100} y $& \x{100} # Bug #59328
ff3f963a
KW
1411/[a\N{U+0100}]/ \x{100} y $& \x{100}
1412/[a\N{U+0100}]/ a y $& a
1413
1414# Verify that \N{U+...} forces Unicode semantics
1415/\N{U+41}\x{c1}/i a\x{e1} y $& a\x{e1}
1416/[\N{U+41}\x{c1}]/i \x{e1} y $& \x{e1}
1417
11454c59 1418[\s][\S] \x{a0}\x{a0} n - - # Unicode complements should not match same character
3cf20fa2
KW
1419
1420# was generating malformed utf8
1421'[\x{100}\xff]'i \x{ff} y $& \x{ff}
e120390b
B
1422
1423((??{ "(?:|)" }))\s C\x20 y - -
40863337 1424
ff3f963a
KW
1425# Verify that \ escapes the { after \N, and causes \N to match non-newline
1426abc\N\{U+BEEF} abc\n{UBEEF} n
1427abc\N\{U+BEEF} abc.{UBEEF} y $& abc.{UBEEF}
1428[abc\N\{U+BEEF}] - c - \\N in a character class must be a named character
1429
1430# Verify that \N can be trailing and causes \N to match non-newline
1431abc\N abcd y $& abcd
1432abc\N abc\n n
1433
1434# Verify get errors. For these, we need // or else puts it in single quotes,
c3c41406 1435# and bypasses the lexer.
ff3f963a 1436/\N{U+}/ - c - Invalid hexadecimal number
c3c41406
KW
1437# Below currently gives a misleading message
1438/[\N{U+}]/ - c - Unmatched
ff3f963a 1439/abc\N{def/ - c - Missing right brace
c3c41406
KW
1440/\N{U+4AG3}/ - c - Illegal hexadecimal digit
1441/[\N{U+4AG3}]/ - c - Illegal hexadecimal digit
1442
1443# And verify that in single quotes which bypasses the lexer, the regex compiler
1444# figures it out.
1445\N{U+} - c - Invalid hexadecimal number
1446[\N{U+}] - c - Invalid hexadecimal number
b9c48b5b 1447\N{U+4AG3} - c - Invalid hexadecimal number
c3c41406
KW
1448[\N{U+4AG3}] - c - Invalid hexadecimal number
1449abc\N{def - c - \\N{NAME} must be resolved by the lexer
1450
1451# Verify that under /x that still cant have space before left brace
1452/abc\N {U+41}/x - c - Missing braces
1453/abc\N {SPACE}/x - c - Missing braces
ff3f963a
KW
1454
1455# Verifies catches hex errors, and doesn't expose our . notation to the outside
0b70ce6f
KW
1456/\N{U+0xBEEF}/ - c - Illegal hexadecimal digit
1457/\N{U+BEEF.BEAD}/ - c - Illegal hexadecimal digit
ff3f963a 1458
c3c41406
KW
1459# Verify works in single quotish context; regex compiler delivers slightly different msg
1460# \N{U+BEEF.BEAD} succeeds here, because can't completely hide it from the outside.
b9c48b5b 1461\N{U+0xBEEF} - c - Invalid hexadecimal number
17a3df4c
KW
1462\c` - c - \"\\c`\" is more clearly written simply as \"\\ \"
1463\c1 - c - \"\\c1\" is more clearly written simply as \"q\"
0b70ce6f 1464\cA \001 y $& \1
c3c41406 1465
fa1639c5
KW
1466\400 \x{100} y $& \x{100}
1467\600 \x{180} y $& \x{180}
1468\777 \x{1FF} y $& \x{1FF}
1469[a\400] \x{100} y $& \x{100}
1470[b\600] \x{180} y $& \x{180}
1471[c\777] \x{1FF} y $& \x{1FF}
f0a2b745
KW
1472\o{120} \x{50} y $& \x{50}
1473\o{400} \x{100} y $& \x{100}
1474\o{1000} \x{200} y $& \x{200}
1475[a\o{120}] \x{50} y $& \x{50}
1476[a\o{400}] \x{100} y $& \x{100}
1477[a\o{1000}] \x{200} y $& \x{200}
fa1639c5 1478
726ee55d
KW
1479# The below were inserting a NULL
1480\87 87 y $& 87
1481a\87 a87 y $& a87
1482a\97 a97 y $& a97
1483
1484
c99e91e9
KW
1485# The below was inserting a NULL into the character class.
1486[\8\9] \000 n - -
1487[\8\9] 8 y $& 8
1488[\8\9] 9 y $& 9
1489
1490# Verify that reads 1-3 octal digits, and that \_ works in char class
1491[\0] \000 y $& \000
1492[\07] \007 y $& \007
1493[\07] 7\000 n - -
1494[\006] \006 y $& \006
1495[\006] 6\000 n - -
1496[\0005] \0005 y $& \000
1497[\0005] 5\000 y $& 5
1498[\_] _ y $& _
1499
779bcb7d
NC
1500# RT #79152
1501(q1|.)*(q2|.)*(x(a|bc)*y){2,} xayxay y $& xayxay
1502(q1|.)*(q2|.)*(x(a|bc)*y){2,3} xayxay y $& xayxay
1503(q1|z)*(q2|z)*z{15}-.*?(x(a|bc)*y){2,3}Z zzzzzzzzzzzzzzzz-xayxayxayxayZ y $& zzzzzzzzzzzzzzzz-xayxayxayxayZ
1504
20dbff7c 1505(?:(?:)foo|bar|zot|rt78356) foo y $& foo
e40e74fe 1506/\xe0\pL/i \xc0a y $& \xc0a
1411dba4
KW
1507
1508# RT #85528
1509(?{})[\x{100}] \x{100} y $& \x{100}
6241f69e
KW
1510
1511# RT #85964
af302e7f 1512^m?(\S)(.*)\1$ aba y $1 a
6241f69e 1513^m?(\S)(.*)\1$ \tb\t n - -
af302e7f 1514^m?(\s)(.*)\1$ \tb\t y $1 \t
6241f69e 1515^m?(\s)(.*)\1$ aba n - -
af302e7f 1516^m?(\W)(.*)\1$ :b: y $1 :
6241f69e 1517^m?(\W)(.*)\1$ aba n - -
af302e7f 1518^m?(\w)(.*)\1$ aba y $1 a
6241f69e 1519^m?(\w)(.*)\1$ :b: n - -
af302e7f 1520^m?(\D)(.*)\1$ aba y $1 a
6241f69e 1521^m?(\D)(.*)\1$ 5b5 n - -
af302e7f 1522^m?(\d)(.*)\1$ 5b5 y $1 5
6241f69e 1523^m?(\d)(.*)\1$ aba n - -
f6a766d5
KW
1524
1525# 17F is 'Long s'; This makes sure the a's in /aa can be separate
1526/s/ai \x{17F} y $& \x{17F}
1527/s/aia \x{17F} n - -
1528/s/aia S y $& S
1529/(?aia:s)/ \x{17F} n - -
1530/(?aia:s)/ S y $& S
827f5bb8
KW
1531
1532# Normally 1E9E generates a multi-char fold, but not in inverted class;
1533# See [perl #89750]. This makes sure that the simple fold gets generated
1534# in that case, to DF.
1535/[^\x{1E9E}]/i \x{DF} n - -
1380b51d
DM
1536
1537# RT #96354
1538/^.*\d\H/ X1 n - -
1539/^.*\d\V/ X1 n - -
1540
45376db6
KW
1541# \p{L_} was being misinterpreted as \p{L}. L_ matches cased letters, which
1542# the ideograph below isn't, whereas it does match L
1543/^\p{L_}/ \x{3400} n - -
1544/^\p{L}/ \x{3400} y $& \x{3400}
1545
fd0f00a9 1546# RT #89774
9d53c457
KW
1547/[s\xDF]a/ui ssa y $& ssa
1548/[s\xDF]a/ui sa y $& sa
fd0f00a9 1549
e47f2755 1550# RT #99928
1978b668 1551/^\R\x0A$/ \x0D\x0A n - -
e47f2755 1552
7b8a8069 1553/ff/i \x{FB00}\x{FB01} y $& \x{FB00}
7c1b9f38 1554/ff/i \x{FB01}\x{FB00} y $& \x{FB00}
7b8a8069 1555/fi/i \x{FB01}\x{FB00} y $& \x{FB01}
7c1b9f38 1556/fi/i \x{FB00}\x{FB01} y $& \x{FB01}
2866decb
DM
1557#
1558# Make sure we don't see code blocks where there aren't, and vice-versa
1559(?#( (?{1+)a a y - -
1560'a# (?{1+'x a y - -
1561ab[(?{1] ab1 y - -
1562ab[(?{1\](?{2] ab2 y - -
1563ab(?{"["})cd abcd y - -
e4a2df84
DM
1564ab(??{"[x]"})cd abxcd y - -
1565ab\[(??{1})c ab[1c y - -
1566ab\\[(??{1;})]c ab\\;c y - -
1567ab\\\[(??{1})c ab\\[1c y - -
1568ab[c\](??{"]d abcd y - -
1569ab[c\\](??{"[x]"})d ab\\xd y - -
1570ab[c\\\](??{"x"})]{3}d ab\\](d y - -
7b8a8069 1571
e067297c
KW
1572# These test that doesn't cut-off matching too soon in the string for
1573# multi-char folds
1574/ffiffl/i abcdef\x{FB03}\x{FB04} y $& \x{FB03}\x{FB04}
1575/\xdf\xdf/ui abcdefssss y $& ssss
1576
7a2d0ccc
KW
1577/st/i \x{DF}\x{FB05} y $& \x{FB05}
1578/ssst/i \x{DF}\x{FB05} y $& \x{DF}\x{FB05}
1579
4f03b4b6
KW
1580# [perl #101970]
1581/[[:lower:]]/i \x{100} y $& \x{100}
1582/[[:upper:]]/i \x{101} y $& \x{101}
1583
ed178f65
KW
1584# Was matching 'ss' only and failing the entire match, not seeing the
1585# alternative that would succeed
bb914485
KW
1586/s\xDF/ui \xDFs y $& \xDFs
1587/sst/ui s\N{LATIN SMALL LIGATURE ST} y $& s\N{LATIN SMALL LIGATURE ST}
1588/sst/ui s\N{LATIN SMALL LIGATURE LONG S T} y $& s\N{LATIN SMALL LIGATURE LONG S T}
ed178f65 1589
35245af4 1590# /i properties shouldn't match more than the property itself
ea317ccb
KW
1591/[[:ascii:]]/i \N{KELVIN SIGN} n - -
1592
dab0c3e7
KW
1593# [[:lower:]]/i and [[:upper:]]/i should match what \p{Lower} and \p{Upper} do.
1594# which is \p{Cased}, not \p{Alpha},
1595/[[:lower:]]/i \N{U+3400} n - -
1596/[[:upper:]]/i \N{U+01BB} n - -
1597
5d103fec
KW
1598# [perl #110648]
1599[^\p{Alphabetic}] \x{100} n - -
1600
b4069bca
KW
1601# [perl #111400]. Tests the first Y/N boundary above 255 for each of these.
1602/[[:alnum:]]/ \x{2c1} y - -
1603/[[:alnum:]]/ \x{2c2} n - -
1604/[[:alpha:]]/ \x{2c1} y - -
1605/[[:alpha:]]/ \x{2c2} n - -
1606/[[:graph:]]/ \x{377} y - -
1607/[[:graph:]]/ \x{378} n - -
1608/[[:lower:]]/ \x{100} n - -
1609/[[:lower:]]/ \x{101} y - -
1610/[[:lower:]]/ \x{102} n - -
1611/[[:print:]]/ \x{377} y - -
1612/[[:print:]]/ \x{378} n - -
1613/[[:punct:]]/ \x{37D} n - -
1614/[[:punct:]]/ \x{37E} y - -
1615/[[:punct:]]/ \x{388} n - -
1616/[[:upper:]]/ \x{100} y - -
1617/[[:upper:]]/ \x{101} n - -
1618/[[:word:]]/ \x{2c1} y - -
1619/[[:word:]]/ \x{2c2} n - -
1620
4adb7801
FC
1621# [perl #113400]
1622/syntax OK\s+\z/si t/bin/good.pl syntax OK\n y - -
b4069bca 1623
df826430
YO
1624/^(.*?)\s*\|\s*(?:\/\s*|)'(.+)'$/ text|'sec' y <$1><$2> <text><sec>
1625/^(foo|)bar$/ bar y <$&> <bar>
1626/^(foo||baz)bar$/ bar y <$&> <bar>
1627/^(foo||baz)bar$/ bazbar y <$1> <baz>
1628/^(foo||baz)bar$/ foobar y <$1> <foo>
1629
1630/^(?:foo|)bar$/ bar y <$&> <bar>
1631/^(?:foo||baz)bar$/ bar y <$&> <bar>
1632/^(?:foo||baz)bar$/ bazbar y <$&> <bazbar>
1633/^(?:foo||baz)bar$/ foobar y <$&> <foobar>
1634
1635/^(?i:foo|)bar$/ bar y <$&> <bar>
1636/^(?i:foo||baz)bar$/ bar y <$&> <bar>
1637/^(?i:foo||baz)bar$/ bazbar y <$&> <bazbar>
1638/^(?i:foo||baz)bar$/ foobar y <$&> <foobar>
1639
f6033a9d
DM
1640# $^N, $+ on backtrackracking
1641# BRANCH
1642^(.)(?:(..)|B)[CX] ABCDE y $^N-$+ A-A -
1643# TRIE
1644^(.)(?:BC(.)|B)[CX] ABCDE y $^N-$+ A-A -
1645# CURLYX
1646^(.)(?:(.)+)*[BX] ABCDE y $^N-$+ A-A -
1647# CURLYM
1648^(.)(BC)* ABCDE y $^N-$+ BC-BC -
1649^(.)(BC)*[BX] ABCDE y $^N-$+ A-A -
1650# CURLYN
1651^(.)(B)*.[DX] ABCDE y $^N-$+ B-B -
1652^(.)(B)*.[CX] ABCDE y $^N-$+ A-A -
1653
cec72654
DM
1654# using 'return' in code blocks
1655^(A)(?{"xyz"})B$ AB y $1-$^R A-xyz -
1656^(A)(?{return "xyz"})B$ AB y $1-$^R A-xyz -
1657^(A)((??{"xyz"}))$ Axyz y $1-$2 A-xyz -
1658^(A)((??{return "xyz"}))$ Axyz y $1-$2 A-xyz -
1659^(A)((?(?{1})abc|xyz))$ Aabc y $1-$2 A-abc -
1660^(A)((?(?{0})abc|xyz))$ Axyz y $1-$2 A-xyz -
1661^(A)((?(?{return 1})abc|xyz))$ Aabc y $1-$2 A-abc -
1662^(A)((?(?{return 0})abc|xyz))$ Axyz y $1-$2 A-xyz -
1663
ec841a27
DM
1664# pattern modifier flags should propagate into returned (??{}) pattern
1665# p,d,l not tested
1666
1667/^(a)((??{"b"}))$/i AB y $1-$2 A-B -
1668/^(A)((??{'B$'}))(\nC)$/m AB\nC y $1-$2-$3 A-B-\nC -
1669/^(A)((??{'.'}))(B)$/s A\nB y $1-$2-$3 A-\n-B -
1670/^(A) ((??{' .'}))(B)$/x A B y $1-$2-$3 A- -B -
1671/^((??{'\d'}))$/a \x{660} n - -
1672/^(??{"s"})$/i \x{17F} y - -
1673/^(??{"s"})$/ia \x{17F} y - -
1674/^(??{"s"})$/iaa \x{17F} n - -
1675/^(??{'\w'})$/u \x{AA} y - -
1676
a8d1f4b4
DM
1677# #113670 ensure any captures to the right are invalidated when CURLY
1678# and CURLYM backtrack
1679
1680^(?:(X)?(\d)|(X)?(\d\d))$ X12 y $1-$2-$3-$4 --X-12
1681^(?:(XX)?(\d)|(XX)?(\d\d))$ XX12 y $1-$2-$3-$4 --XX-12
1682
190c1910
YO
1683# rt 113770
1684\A(?>\[(?:(?:)(?:R){1}|T|V?|A)\])\z [A] y $& [A]
ac7af3f6
YO
1685# rt 114068
1686/( [^z] $ [^z]+)/xm aa\nbb\ncc\n y $1 a\nbb\ncc\n
d8661376
KW
1687
1688# [perl #114220]
1689/[\h]/ \x{A0} y $& \xA0
1690/[\H]/ \x{BF} y $& \xBF
1691/[\H]/ \x{A0} n - -
1692/[\H]/ \x{A1} y $& \xA1
1693
5a279aa0
KW
1694[^\n]+ \nb y $& b
1695[^\n]+ a\n y $& a
1696
0658cdde
KW
1697# /a has no effect on properties
1698(?a:\p{Any}) \x{100} y $& \x{100}
1699(?aa:\p{Any}) \x{100} y $& \x{100}
1700
7a4d6ad6
KW
1701\w \x{200C} y $& \x{200C}
1702\W \x{200C} n - -
1703\w \x{200D} y $& \x{200D}
1704\W \x{200D} n - -
1705
7dff6b46 1706/^(?d:\xdf|_)*_/i \x{17f}\x{17f}_ y $& \x{17f}\x{17f}_
6502e081
DM
1707#
1708# check that @-, @+ count chars, not bytes; especially if beginning of
1709# string is not copied
1710
1711(\x{100}) \x{2000}\x{2000}\x{2000}\x{100} y $-[0]:$-[1]:$+[0]:$+[1] 3:3:4:4
7dff6b46 1712
565fc1bb
KW
1713^\R{2}$ \r\n\r\n y $& \r\n\r\n
1714
4063ade8
KW
1715/^\D{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1716/^\S{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1717/^\W{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1718
d87fc68d
KW
1719# [ perl #114272]
1720\Vn \xFFn/ yT $& \xFFn
1721
0b70ce6f 1722# vim: softtabstop=0 noexpandtab