This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add comments that re tests can be commented in col 7
[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 7#
3238b147 8# pat string y/n/etc expr expected-expr skip-reason comment
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-
073b366a 111a[b-a] - c - Invalid [] range
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
PP
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
PP
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-
073b366a 355'a[b-a]'i - c - Invalid [] range
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 - -
0f7276ab
KW
585(?(1?)a|b) - c - Switch condition not recognized
586(?(1)a|b|c) - 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
e22f9b1c
NC
595(?(?!\x{100})\x{100}|b) \x{100} n - -
596(?(?!\x{100})b|\x{100}) \x{100} y $& \x{100}
597(?(?=\x{100})b|\x{100}) \x{100} n - -
598(?(?=\x{100})\x{100}|b) \x{100} y $& \x{100}
c277df42
IZ
599(?=(a+?))(\1ab) aaab y $2 aab
600^(?=(a+?))\1ab aaab n - -
601(\w+:)+ one: y $1 one:
602$(?<=^(a)) a y $1 a
603(?=(a+?))(\1ab) aaab y $2 aab
604^(?=(a+?))\1ab aaab n - -
605([\w:]+::)?(\w+)$ abcd: n - -
606([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
607([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
608^[^bcd]*(c+) aexycd y $1 c
609(a*)b+ caab y $1 aa
610([\w:]+::)?(\w+)$ abcd: n - -
611([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
612([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
613^[^bcd]*(c+) aexycd y $1 c
94c1d7aa
DM
614(?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a}) yaaxxaaaacd y $b 3
615(?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a}) yaaxxaaaacd y $b 4
f5df269c
FC
616# [perl #117917]
617^(a(?{ "x" =~ m{x}})b)(??{ $1 }) abab y $& abab
c277df42 618(>a+)ab aaab n - -
fe44a5e8 619(?>a+)b aaab y - -
4599a1de
JH
620([[:]+) a:[b]: y $1 :[
621([[=]+) a=[b]= y $1 =[
622([[.]+) a.[b]. y $1 .[
24b61696
RK
623[a[:xyz: - c - Unmatched [
624[a[:xyz:] - c - POSIX class [:xyz:] unknown
767d463e 625[a[:]b[:c] abc y $& abc
0f7276ab 626([a[:xyz:]b]+) - c - POSIX class [:xyz:] unknown
b8c5462f
JH
627([[:alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
628([[:alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
629([[:ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__-- ${nulnul}
630([[:cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}
631([[:digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
632([[:graph:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
633([[:lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd
634([[:print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
635([[:punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __--
636([[:space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1
637([[:word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__
638([[:upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
639([[:xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01
640([[:^alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
cfaf538b 641((?a)[[:^alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __-- ${nulnul}${ffff}
b8c5462f 642([[:^ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${ffff}
2a79fb66 643([:[:^ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${ffff} RT #120799
b8c5462f
JH
644([[:^cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
645([[:^digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
646([[:^lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
cfaf538b 647((?a)[[:^print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}${ffff}
b8c5462f
JH
648([[:^punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
649([[:^space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
cfaf538b 650((?a)[[:^word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 -- ${nulnul}${ffff}
b8c5462f
JH
651([[:^upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd01
652([[:^xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 Xy__-- ${nulnul}${ffff}
24b61696
RK
653[[:foo:]] - c - POSIX class [:foo:] unknown
654[[:^foo:]] - c - POSIX class [:^foo:] unknown
fe44a5e8
IZ
655((?>a+)b) aaab y $1 aaab
656(?>(a+))b aaab y $1 aaa
c277df42 657((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
24b61696 658(?<=x+)y - c - Variable length lookbehind not implemented
31c15ce5 659((def){37,17})?ABC ABC y $& ABC
cf93c79d
IZ
660\Z a\nb\n y $-[0] 3
661\z a\nb\n y $-[0] 4
662$ a\nb\n y $-[0] 3
663\Z b\na\n y $-[0] 3
664\z b\na\n y $-[0] 4
665$ b\na\n y $-[0] 3
666\Z b\na y $-[0] 3
667\z b\na y $-[0] 3
668$ b\na y $-[0] 3
669'\Z'm a\nb\n y $-[0] 3
670'\z'm a\nb\n y $-[0] 4
671'$'m a\nb\n y $-[0] 1
672'\Z'm b\na\n y $-[0] 3
673'\z'm b\na\n y $-[0] 4
674'$'m b\na\n y $-[0] 1
675'\Z'm b\na y $-[0] 3
676'\z'm b\na y $-[0] 3
677'$'m b\na y $-[0] 1
b85d18e9 678a\Z a\nb\n n - -
cf93c79d
IZ
679a\z a\nb\n n - -
680a$ a\nb\n n - -
681a\Z b\na\n y $-[0] 2
682a\z b\na\n n - -
683a$ b\na\n y $-[0] 2
684a\Z b\na y $-[0] 2
685a\z b\na y $-[0] 2
686a$ b\na y $-[0] 2
a1917ab9 687'a\Z'm a\nb\n n - -
cf93c79d
IZ
688'a\z'm a\nb\n n - -
689'a$'m a\nb\n y $-[0] 0
690'a\Z'm b\na\n y $-[0] 2
691'a\z'm b\na\n n - -
692'a$'m b\na\n y $-[0] 2
693'a\Z'm b\na y $-[0] 2
694'a\z'm b\na y $-[0] 2
695'a$'m b\na y $-[0] 2
696aa\Z aa\nb\n n - -
697aa\z aa\nb\n n - -
698aa$ aa\nb\n n - -
699aa\Z b\naa\n y $-[0] 2
700aa\z b\naa\n n - -
701aa$ b\naa\n y $-[0] 2
702aa\Z b\naa y $-[0] 2
703aa\z b\naa y $-[0] 2
704aa$ b\naa y $-[0] 2
a1917ab9 705'aa\Z'm aa\nb\n n - -
cf93c79d
IZ
706'aa\z'm aa\nb\n n - -
707'aa$'m aa\nb\n y $-[0] 0
708'aa\Z'm b\naa\n y $-[0] 2
709'aa\z'm b\naa\n n - -
710'aa$'m b\naa\n y $-[0] 2
711'aa\Z'm b\naa y $-[0] 2
712'aa\z'm b\naa y $-[0] 2
713'aa$'m b\naa y $-[0] 2
714aa\Z ac\nb\n n - -
715aa\z ac\nb\n n - -
716aa$ ac\nb\n n - -
717aa\Z b\nac\n n - -
718aa\z b\nac\n n - -
719aa$ b\nac\n n - -
720aa\Z b\nac n - -
721aa\z b\nac n - -
722aa$ b\nac n - -
723'aa\Z'm ac\nb\n n - -
724'aa\z'm ac\nb\n n - -
725'aa$'m ac\nb\n n - -
726'aa\Z'm b\nac\n n - -
727'aa\z'm b\nac\n n - -
728'aa$'m b\nac\n n - -
729'aa\Z'm b\nac n - -
730'aa\z'm b\nac n - -
731'aa$'m b\nac n - -
732aa\Z ca\nb\n n - -
733aa\z ca\nb\n n - -
734aa$ ca\nb\n n - -
735aa\Z b\nca\n n - -
736aa\z b\nca\n n - -
737aa$ b\nca\n n - -
738aa\Z b\nca n - -
739aa\z b\nca n - -
740aa$ b\nca n - -
741'aa\Z'm ca\nb\n n - -
742'aa\z'm ca\nb\n n - -
743'aa$'m ca\nb\n n - -
744'aa\Z'm b\nca\n n - -
745'aa\z'm b\nca\n n - -
746'aa$'m b\nca\n n - -
747'aa\Z'm b\nca n - -
748'aa\z'm b\nca n - -
749'aa$'m b\nca n - -
750ab\Z ab\nb\n n - -
751ab\z ab\nb\n n - -
752ab$ ab\nb\n n - -
753ab\Z b\nab\n y $-[0] 2
754ab\z b\nab\n n - -
755ab$ b\nab\n y $-[0] 2
756ab\Z b\nab y $-[0] 2
757ab\z b\nab y $-[0] 2
758ab$ b\nab y $-[0] 2
a1917ab9 759'ab\Z'm ab\nb\n n - -
cf93c79d
IZ
760'ab\z'm ab\nb\n n - -
761'ab$'m ab\nb\n y $-[0] 0
762'ab\Z'm b\nab\n y $-[0] 2
763'ab\z'm b\nab\n n - -
764'ab$'m b\nab\n y $-[0] 2
765'ab\Z'm b\nab y $-[0] 2
766'ab\z'm b\nab y $-[0] 2
767'ab$'m b\nab y $-[0] 2
768ab\Z ac\nb\n n - -
769ab\z ac\nb\n n - -
770ab$ ac\nb\n n - -
771ab\Z b\nac\n n - -
772ab\z b\nac\n n - -
773ab$ b\nac\n n - -
774ab\Z b\nac n - -
775ab\z b\nac n - -
776ab$ b\nac n - -
777'ab\Z'm ac\nb\n n - -
778'ab\z'm ac\nb\n n - -
779'ab$'m ac\nb\n n - -
780'ab\Z'm b\nac\n n - -
781'ab\z'm b\nac\n n - -
782'ab$'m b\nac\n n - -
783'ab\Z'm b\nac n - -
784'ab\z'm b\nac n - -
785'ab$'m b\nac n - -
786ab\Z ca\nb\n n - -
787ab\z ca\nb\n n - -
788ab$ ca\nb\n n - -
789ab\Z b\nca\n n - -
790ab\z b\nca\n n - -
791ab$ b\nca\n n - -
792ab\Z b\nca n - -
793ab\z b\nca n - -
794ab$ b\nca n - -
795'ab\Z'm ca\nb\n n - -
796'ab\z'm ca\nb\n n - -
797'ab$'m ca\nb\n n - -
798'ab\Z'm b\nca\n n - -
799'ab\z'm b\nca\n n - -
800'ab$'m b\nca\n n - -
801'ab\Z'm b\nca n - -
802'ab\z'm b\nca n - -
803'ab$'m b\nca n - -
804abb\Z abb\nb\n n - -
805abb\z abb\nb\n n - -
806abb$ abb\nb\n n - -
807abb\Z b\nabb\n y $-[0] 2
808abb\z b\nabb\n n - -
809abb$ b\nabb\n y $-[0] 2
810abb\Z b\nabb y $-[0] 2
811abb\z b\nabb y $-[0] 2
812abb$ b\nabb y $-[0] 2
a1917ab9 813'abb\Z'm abb\nb\n n - -
cf93c79d
IZ
814'abb\z'm abb\nb\n n - -
815'abb$'m abb\nb\n y $-[0] 0
816'abb\Z'm b\nabb\n y $-[0] 2
817'abb\z'm b\nabb\n n - -
818'abb$'m b\nabb\n y $-[0] 2
819'abb\Z'm b\nabb y $-[0] 2
820'abb\z'm b\nabb y $-[0] 2
821'abb$'m b\nabb y $-[0] 2
822abb\Z ac\nb\n n - -
823abb\z ac\nb\n n - -
824abb$ ac\nb\n n - -
825abb\Z b\nac\n n - -
826abb\z b\nac\n n - -
827abb$ b\nac\n n - -
828abb\Z b\nac n - -
829abb\z b\nac n - -
830abb$ b\nac n - -
831'abb\Z'm ac\nb\n n - -
832'abb\z'm ac\nb\n n - -
833'abb$'m ac\nb\n n - -
834'abb\Z'm b\nac\n n - -
835'abb\z'm b\nac\n n - -
836'abb$'m b\nac\n n - -
837'abb\Z'm b\nac n - -
838'abb\z'm b\nac n - -
839'abb$'m b\nac n - -
840abb\Z ca\nb\n n - -
841abb\z ca\nb\n n - -
842abb$ ca\nb\n n - -
843abb\Z b\nca\n n - -
844abb\z b\nca\n n - -
845abb$ b\nca\n n - -
846abb\Z b\nca n - -
847abb\z b\nca n - -
848abb$ b\nca n - -
849'abb\Z'm ca\nb\n n - -
850'abb\z'm ca\nb\n n - -
851'abb$'m ca\nb\n n - -
852'abb\Z'm b\nca\n n - -
853'abb\z'm b\nca\n n - -
854'abb$'m b\nca\n n - -
855'abb\Z'm b\nca n - -
856'abb\z'm b\nca n - -
857'abb$'m b\nca n - -
fad493ef 858'\Aa$'m a\n\n y $& a
8e680dc3 859(^|x)(c) ca y $2 c
aca2d497 860a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz x n - -
94c1d7aa 861a(?{$a=2;$b=3;($b)=$a})b yabz y $b 2
9fe1d20c 862round\(((?>[^()]+))\) _I(round(xs * sz),1) y $1 xs * sz
ce3e6498
HS
863'((?x:.) )' x y $1- x -
864'((?-x:.) )'x x y $1- x-
adac82c7 865foo.bart foo.bart y - -
2c2d71f5
JH
866'^d[x][x][x]'m abcd\ndxxx y - -
867.X(.+)+X bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
868.X(.+)+XX bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
869.XX(.+)+X bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
870.X(.+)+X bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
871.X(.+)+XX bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
872.XX(.+)+X bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
873.X(.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
874.X(.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
875.XX(.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
876.X(.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
877.X(.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
878.XX(.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
879.[X](.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
880.[X](.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
881.[X][X](.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
882.[X](.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
883.[X](.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
884.[X][X](.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
885tt+$ xxxtt y - -
073b366a
KW
886([a-\d]+) za-9z Sy $1 a-9
887([a-\d]+) - sc - False [] range
888([\d-z]+) a0-za Sy $1 0-z
889([\d-z]+) - sc $1 False [] range
890([\d-\s]+) a0- z Sy $1 0-
891([\d-\s]+) - sc $1 False [] range
892([a-[:digit:]]+) za-9z Sy $1 a-9
893([a-[:digit:]]+) - sc - False [] range
894([[:digit:]-z]+) =0-z= Sy $1 0-z
895([[:digit:]-z]+) - sc c False [] range
896([[:digit:]-[:alpha:]]+) =0-z= Sy $1 0-z
897([[:digit:]-[:alpha:]]+) - sc - False [] range
30382c73 898\GX.*X aaaXbX n - -
6eb5f6b9
JH
899(\d+\.\d+) 3.1415926 y $1 3.1415926
900(\ba.{0,10}br) have a web browser y $1 a web br
66e933ab
GS
901'\.c(pp|xx|c)?$'i Changes n - -
902'\.c(pp|xx|c)?$'i IO.c y - -
903'(\.c(pp|xx|c)?$)'i IO.c y $1 .c
653099ff 904^([a-z]:) C:/ n - -
60e71179 905'^\S\s+aa$'m \nx aa y - -
de0c8cb8 906(^|a)b ab y - -
f06a1d4e 907^([ab]*?)(b)?(c)$ abac y -$2- --
29d1e993 908(\w)?(abc)\1b abcab n - -
2a8d9689
HS
909^(?:.,){2}c a,b,c y - -
910^(.,){2}c a,b,c y $1 b,
911^(?:[^,]*,){2}c a,b,c y - -
912^([^,]*,){2}c a,b,c y $1 b,
4b2cff9a
HS
913^([^,]*,){3}d aaa,b,c,d y $1 c,
914^([^,]*,){3,}d aaa,b,c,d y $1 c,
915^([^,]*,){0,3}d aaa,b,c,d y $1 c,
916^([^,]{1,3},){3}d aaa,b,c,d y $1 c,
917^([^,]{1,3},){3,}d aaa,b,c,d y $1 c,
918^([^,]{1,3},){0,3}d aaa,b,c,d y $1 c,
919^([^,]{1,},){3}d aaa,b,c,d y $1 c,
920^([^,]{1,},){3,}d aaa,b,c,d y $1 c,
921^([^,]{1,},){0,3}d aaa,b,c,d y $1 c,
922^([^,]{0,3},){3}d aaa,b,c,d y $1 c,
923^([^,]{0,3},){3,}d aaa,b,c,d y $1 c,
924^([^,]{0,3},){0,3}d aaa,b,c,d y $1 c,
bf93d4cc 925(?i) y - -
cfaf538b 926(?a:((?u)\w)\W) \xC0\xC0 y $& \xC0\xC0
c2a73568 927'(?!\A)x'm a\nxb\n y - -
c1d44abf
JH
928^(a(b)?)+$ aba y -$1-$2- -a--
929^(aa(bb)?)+$ aabbaa y -$1-$2- -aa--
0e41cd87 930'^.{9}abc.*\n'm 123\nabcabcabcabc\n y - -
66417f84
HS
931^(a)?a$ a y -$1- --
932^(a)?(?(1)a|b)+$ a n - -
cb434fcc
IZ
933^(a\1?)(a\1?)(a\2?)(a\3?)$ aaaaaa y $1,$2,$3,$4 a,aa,a,aa
934^(a\1?){4}$ aaaaaa y $1 aa
935^(0+)?(?:x(1))? x1 y - -
936^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))? 012cxx0190 y - -
e1901655
IZ
937^(b+?|a){1,2}c bbbac y $1 a
938^(b+?|a){1,2}c bbbbac y $1 a
2e36c929 939\((\w\. \w+)\) cd. (A. Tw) y -$1- -A. Tw-
f49d4d0f
HS
940((?:aaaa|bbbb)cccc)? aaaacccc y - -
941((?:aaaa|bbbb)cccc)? bbbbcccc y - -
36670241
JH
942(a)?(a)+ a y $1:$2 :a -
943(ab)?(ab)+ ab y $1:$2 :ab -
944(abc)?(abc)+ abc y $1:$2 :abc -
12d33761 945'b\s^'m a\nb\n n - -
ee0b7718 946\ba a y - -
61525e55 947^(a(??{"(?!)"})|(a)(?{1}))b ab y $2 a # [ID 20010811.006]
055bb491
HS
948ab(?i)cd AbCd n - - # [ID 20010809.023]
949ab(?i)cd abCd y - -
f31a99c8
HS
950(A|B)*(?(1)(CD)|(CD)) CD y $2-$3 -CD
951(A|B)*(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
952(A|B)*?(?(1)(CD)|(CD)) CD y $2-$3 -CD # [ID 20010803.016]
953(A|B)*?(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
f65d3ee7 954'^(o)(?!.*\1)'i Oo n - -
24ba5a3c 955(.*)\d+\1 abc12bc y $1 bc
1ac24cf0 956(?m:(foo\s*$)) foo\n bar y $1 foo
a84d97b6
HS
957(.*)c abcd y $1 ab
958(.*)(?=c) abcd y $1 ab
959(.*)(?=c)c abcd yB $1 ab
960(.*)(?=b|c) abcd y $1 ab
961(.*)(?=b|c)c abcd y $1 ab
962(.*)(?=c|b) abcd y $1 ab
963(.*)(?=c|b)c abcd y $1 ab
964(.*)(?=[bc]) abcd y $1 ab
965(.*)(?=[bc])c abcd yB $1 ab
966(.*)(?<=b) abcd y $1 ab
967(.*)(?<=b)c abcd y $1 ab
968(.*)(?<=b|c) abcd y $1 abc
969(.*)(?<=b|c)c abcd y $1 ab
970(.*)(?<=c|b) abcd y $1 abc
971(.*)(?<=c|b)c abcd y $1 ab
972(.*)(?<=[bc]) abcd y $1 abc
973(.*)(?<=[bc])c abcd y $1 ab
974(.*?)c abcd y $1 ab
975(.*?)(?=c) abcd y $1 ab
976(.*?)(?=c)c abcd yB $1 ab
977(.*?)(?=b|c) abcd y $1 a
978(.*?)(?=b|c)c abcd y $1 ab
979(.*?)(?=c|b) abcd y $1 a
980(.*?)(?=c|b)c abcd y $1 ab
981(.*?)(?=[bc]) abcd y $1 a
982(.*?)(?=[bc])c abcd yB $1 ab
983(.*?)(?<=b) abcd y $1 ab
984(.*?)(?<=b)c abcd y $1 ab
985(.*?)(?<=b|c) abcd y $1 ab
986(.*?)(?<=b|c)c abcd y $1 ab
987(.*?)(?<=c|b) abcd y $1 ab
988(.*?)(?<=c|b)c abcd y $1 ab
989(.*?)(?<=[bc]) abcd y $1 ab
990(.*?)(?<=[bc])c abcd y $1 ab
d3aea5f7 9912(]*)?$\1 2 y $& 2
61525e55 992(??{}) x y - -
ecc99935 993a(b)?? abc y <$1> <> # undef [perl #16773]
c152dc43 994(\d{1,3}\.){3,} 128.134.142.8 y <$1> <142.> # [perl #18019]
b0e70d55
HS
995^.{3,4}(.+)\1\z foobarbar y $1 bar # 16 tests for [perl #23171]
996^(?:f|o|b){3,4}(.+)\1\z foobarbar y $1 bar
997^.{3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
998^(?:f|o|b){3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
999^.{3,4}(.+?)\1\z foobarbar y $1 bar
1000^(?:f|o|b){3,4}(.+?)\1\z foobarbar y $1 bar
1001^.{3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
1002^(?:f|o|b){3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
1003^.{2,3}?(.+)\1\z foobarbar y $1 bar
1004^(?:f|o|b){2,3}?(.+)\1\z foobarbar y $1 bar
1005^.{2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
1006^(?:f|o|b){2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
1007^.{2,3}?(.+?)\1\z foobarbar y $1 bar
1008^(?:f|o|b){2,3}?(.+?)\1\z foobarbar y $1 bar
1009^.{2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
1010^(?:f|o|b){2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
c2b0868c 1011.*a(?!(b|cd)*e).*f ......abef n - - # [perl #23030]
0f7276ab
KW
1012x(?# - c - Sequence (?#... not terminated
1013:x(?#: - c - Sequence (?#... not terminated
a3621e74
YO
1014(WORDS|WORD)S WORDS y $1 WORD
1015(X.|WORDS|X.|WORD)S WORDS y $1 WORD
1016(WORDS|WORLD|WORD)S WORDS y $1 WORD
1017(X.|WORDS|WORD|Y.)S WORDS y $1 WORD
1018(foo|fool|x.|money|parted)$ fool y $1 fool
1019(x.|foo|fool|x.|money|parted|y.)$ fool y $1 fool
1020(foo|fool|money|parted)$ fool y $1 fool
1021(foo|fool|x.|money|parted)$ fools n - -
1022(x.|foo|fool|x.|money|parted|y.)$ fools n - -
1023(foo|fool|money|parted)$ fools n - -
3dab1dad 1024(a|aa|aaa||aaaa|aaaaa|aaaaaa)(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
61525e55
NC
1025(a|aa|aaa||aaaa|aaaaa|aaaaaa)(??{$1&&""})(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
1026(a|aa|aaa|aaaa|aaaaa|aaaaaa)(??{$1&&"foo"})(b|c) aaaaaaaaaaaaaaab n - -
3ab3c9b4
HS
1027^(a*?)(?!(aa|aaaa)*$) aaaaaaaaaaaaaaaaaaaa y $1 a # [perl #34195]
1028^(a*?)(?!(aa|aaaa)*$)(?=a\z) aaaaaaaa y $1 aaaaaaa
c315bfe8 1029^(.)\s+.$(?(1)) A B y $1 A # [perl #37688]
3a2830be
A
1030(?:r?)*?r|(.{2,4}) abcde y $1 abcd
1031(?!)+?|(.{2,4}) abcde y $1 abcd
7409bbd3 1032^(a*?)(?!(a{6}|a{5})*$) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y $+[1] 12 # super-linear cache bug may return 18
dad79028
DM
1033^((?>(?:aa)?b)?) aab y $1 aab
1034^((?:aa)*)(?:X+((?:\d+|-)(?:X+(.+))?))?$ aaaaX5 y $1 aaaa
3dab1dad
YO
1035X(A|B||C|D)Y XXXYYY y $& XY # Trie w/ NOTHING
1036(?i:X([A]|[B]|y[Y]y|[D]|)Y) XXXYYYB y $& XY # Trie w/ NOTHING
40a82448 1037^([a]{1})*$ aa y $1 a
3298f257
DM
1038a(?!b(?!c))(..) abababc y $1 bc # test nested negatives
1039a(?!b(?=a))(..) abababc y $1 bc # test nested lookaheads
1040a(?!b(?!c(?!d(?!e))))...(.) abxabcdxabcde y $1 e
1041X(?!b+(?!(c+)*(?!(c+)*d))).*X aXbbbbbbbcccccccccccccaaaX y - -
786e8c11
YO
1042^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1043^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1044^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1045^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1046^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1047^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1048^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1049^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1050^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1051^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1052^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1053^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1054X(?:ABCF[cC]x*|ABCD|ABCF):(?:DIT|DID|DIM) XABCFCxxxxxxxxxx:DIM y $& XABCFCxxxxxxxxxx:DIM
1055(((ABCD|ABCE|ABCF)))(A|B|C[xy]*): ABCFCxxxxxxxxxx:DIM y $& ABCFCxxxxxxxxxx:
1de06328
YO
1056(?=foo) foo y pos 0
1057(?=foo) XfooY y pos 1
1058.*(?=foo) XfooY y pos 1
1059(?<=foo) foo y pos 3
1060(?<=foo) XfooY y pos 4
1061.*(?<=foo) foo y pos 3
1062.*(?<=foo) XfooY y pos 4
1063(?<=foo)Y XfooY y pos 5
1064o(?<=foo)Y ..XfooY.. y pos 7
1065X(?=foo)f ..XfooY.. y pos 4
1066X(?=foo) ..XfooY.. y pos 3
1067X(?<=foo.)[YZ] ..XfooXY.. y pos 8
1068(?=XY*foo) Xfoo y pos 0
1069^(?=XY*foo) Xfoo y pos 0
61525e55
NC
1070^(??{"a+"})a aa y $& aa
1071^(?:(??{"a+"})|b)a aa y $& aa
1072^(??{chr 0x100}).$ \x{100}\x{100} y $& \x{100}\x{100}
1073^(??{q(\x{100})}). \x{100}\x{100} y $& \x{100}\x{100}
1074^(??{q(.+)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1075^(??{q(.)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1076^(??{chr 0x100})\xbb \x{100}\x{bb} y $& \x{100}\x{bb}
1077^(.)(??{"(.)(.)"})(.)$ abcd y $1-$2 a-d
1078^(.)(??{"(bz+|.)(.)"})(.)$ abcd y $1-$2 a-d
1079^(.)((??{"(.)(cz+)"})|.) abcd y $1-$2 a-b
1080^a(?>(??{q(b)}))(??{q(c)})d abcd y - -
1081^x(??{""})+$ x y $& x
6bda09f9
YO
1082^(<(?:[^<>]+|(?3)|(?1))*>)()(!>!>!>)$ <<!>!>!>><>>!>!>!> y $1 <<!>!>!>><>>
1083^(<(?:[^<>]+|(?1))*>)$ <<><<<><>>>> y $1 <<><<<><>>>>
1084((?2)*)([fF]o+) fooFoFoo y $1-$2 fooFo-Foo
1085(<(?:[^<>]+|(?R))*>) <<><<<><>>>> y $1 <<><<<><>>>>
81714fb9 1086(?<n>foo|bar|baz) snofooewa y $1 foo
cb6fa888
NC
1087(?<n>foo|bar|baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1088(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1089(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1090(?<n>foo)|(?<n>bar)|(?<n>baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1091(?<n>foo)(??{ $+{n} }) snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe 1092(?P<n>foo|bar|baz) snofooewa y $1 foo
cb6fa888
NC
1093(?P<n>foo|bar|baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1094(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1095(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1096(?P<n>foo)|(?P<n>bar)|(?P<n>baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1097(?P<n>foo)(??{ $+{n} }) snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
0f7276ab
KW
1098(?P<=n>foo|bar|baz) - c - Group name must start with a non-digit word character
1099(?P<!n>foo|bar|baz) - c - Group name must start with a non-digit word character
1100(?PX<n>foo|bar|baz) - c - Sequence (?PX<...) not recognized
81714fb9 1101/(?'n'foo|bar|baz)/ snofooewa y $1 foo
cb6fa888
NC
1102/(?'n'foo|bar|baz)/ snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1103/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1104/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1105/(?'n'foo)|(?'n'bar)|(?<n>baz)/ snobazewa yM $+{n} baz miniperl cannot load Tie::Hash::NamedCapture
1106/(?'n'foo)(??{ $+{n} })/ snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
81714fb9 1107/(?'n'foo)\k<n>/ ..foofoo.. y $1 foo
cb6fa888 1108/(?'n'foo)\k<n>/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
81714fb9 1109/(?<n>foo)\k'n'/ ..foofoo.. y $1 foo
cb6fa888
NC
1110/(?<n>foo)\k'n'/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1111/(?:(?<n>foo)|(?<n>bar))\k<n>/ ..barbar.. yM $+{n} bar miniperl cannot load Tie::Hash::NamedCapture
1112/^(?'main'<(?:[^<>]+|(?&crap)|(?&main))*>)(?'empty')(?'crap'!>!>!>)$/ <<!>!>!>><>>!>!>!> yM $+{main} <<!>!>!>><>> miniperl cannot load Tie::Hash::NamedCapture
894be9b7 1113/^(?'main'<(?:[^<>]+|(?&main))*>)$/ <<><<<><>>>> y $1 <<><<<><>>>>
cb6fa888
NC
1114/(?'first'(?&second)*)(?'second'[fF]o+)/ fooFoFoo yM $+{first}-$+{second} fooFo-Foo miniperl cannot load Tie::Hash::NamedCapture
1115(?<A>foo)?(?(<A>)bar|nada) foobar yM $+{A} foo miniperl cannot load Tie::Hash::NamedCapture
0a4db386
YO
1116(?<A>foo)?(?(<A>)bar|nada) foo-barnada y $& nada
1117(?<A>foo)?(?(1)bar|nada) foo-barnada y $& nada
1118(?<A>foo(?(R)bar))?(?1) foofoobar y $1 foo
1119(?<A>foo(?(R)bar))?(?1) foofoobar y $& foofoobar
1120(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $2 foo
1121(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $& xfoofoobar
1122(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $2 foo
1123(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $& xfoofoobar
1124(?1)(?(DEFINE)(blah)) blah y $& blah
1125/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamimadam y $& madamimadam
1126/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamiamadam n - -
1127/(a)?((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1128/(a)*((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1129/(a)+((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1130/(a){1,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1131/(a){0,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1132/(ab)?((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1133/(ab)*((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1134/(ab)+((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1135/(ab){1,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1136/(ab){0,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
b9b4dddf
YO
1137# possessive captures
1138a++a aaaaa n - -
1139a*+a aaaaa n - -
1140a{1,5}+a aaaaa n - -
1141a?+a ab n - -
1142a++b aaaaab y $& aaaaab
1143a*+b aaaaab y $& aaaaab
1144a{1,5}+b aaaaab y $& aaaaab
1145a?+b ab y $& ab
1146fooa++a fooaaaaa n - -
1147fooa*+a fooaaaaa n - -
1148fooa{1,5}+a fooaaaaa n - -
1149fooa?+a fooab n - -
1150fooa++b fooaaaaab y $& fooaaaaab
1151fooa*+b fooaaaaab y $& fooaaaaab
1152fooa{1,5}+b fooaaaaab y $& fooaaaaab
1153fooa?+b fooab y $& fooab
1154(?:aA)++(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1155(aA)++(aA) aAaAaAaAaA n - aAaAaAaAaA
1156(aA|bB)++(aA|bB) aAaAbBaAbB n - aAaAbBaAbB
1157(?:aA|bB)++(?:aA|bB) aAbBbBbBaA n - aAbBbBbBaA
1158(?:aA)*+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1159(aA)*+(aA) aAaAaAaAaA n - aAaAaAaAaA
1160(aA|bB)*+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1161(?:aA|bB)*+(?:aA|bB) aAaAaAbBaA n - aAaAaAbBaA
1162(?:aA){1,5}+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1163(aA){1,5}+(aA) aAaAaAaAaA n - aAaAaAaAaA
1164(aA|bB){1,5}+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1165(?:aA|bB){1,5}+(?:aA|bB) bBbBbBbBbB n - bBbBbBbBbB
1166(?:aA)?+(?:aA) aAb n - aAb
1167(aA)?+(aA) aAb n - aAb
1168(aA|bB)?+(aA|bB) bBb n - bBb
1169(?:aA|bB)?+(?:aA|bB) aAb n - aAb
1170(?:aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1171(aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1172(aA|bB)++b aAbBaAaAbBb y $& aAbBaAaAbBb
1173(?:aA|bB)++b aAbBbBaAaAb y $& aAbBbBaAaAb
1174(?:aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1175(aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1176(aA|bB)*+b bBbBbBbBbBb y $& bBbBbBbBbBb
1177(?:aA|bB)*+b bBaAbBbBaAb y $& bBaAbBbBaAb
1178(?:aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1179(aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1180(aA|bB){1,5}+b bBaAbBaAbBb y $& bBaAbBaAbBb
1181(?:aA|bB){1,5}+b aAbBaAbBbBb y $& aAbBaAbBbBb
1182(?:aA)?+b aAb y $& aAb
1183(aA)?+b aAb y $& aAb
1184(aA|bB)?+b bBb y $& bBb
1185(?:aA|bB)?+b bBb y $& bBb
1186foo(?:aA)++(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1187foo(aA)++(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1188foo(aA|bB)++(aA|bB) foobBbBbBaAaA n - foobBbBbBaAaA
1189foo(?:aA|bB)++(?:aA|bB) fooaAaAaAaAaA n - fooaAaAaAaAaA
1190foo(?:aA)*+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1191foo(aA)*+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1192foo(aA|bB)*+(aA|bB) foobBaAbBaAaA n - foobBaAbBaAaA
1193foo(?:aA|bB)*+(?:aA|bB) fooaAaAbBbBaA n - fooaAaAbBbBaA
1194foo(?:aA){1,5}+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1195foo(aA){1,5}+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1196foo(aA|bB){1,5}+(aA|bB) fooaAbBbBaAaA n - fooaAbBbBaAaA
1197foo(?:aA|bB){1,5}+(?:aA|bB) fooaAbBbBaAbB n - fooaAbBbBaAbB
1198foo(?:aA)?+(?:aA) fooaAb n - fooaAb
1199foo(aA)?+(aA) fooaAb n - fooaAb
1200foo(aA|bB)?+(aA|bB) foobBb n - foobBb
1201foo(?:aA|bB)?+(?:aA|bB) fooaAb n - fooaAb
1202foo(?:aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1203foo(aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1204foo(aA|bB)++b foobBaAbBaAbBb y $& foobBaAbBaAbBb
1205foo(?:aA|bB)++b fooaAaAbBaAaAb y $& fooaAaAbBaAaAb
1206foo(?:aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1207foo(aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1208foo(aA|bB)*+b foobBbBaAaAaAb y $& foobBbBaAaAaAb
1209foo(?:aA|bB)*+b foobBaAaAbBaAb y $& foobBaAaAbBaAb
1210foo(?:aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1211foo(aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1212foo(aA|bB){1,5}+b foobBaAaAaAaAb y $& foobBaAaAaAaAb
1213foo(?:aA|bB){1,5}+b fooaAbBaAbBbBb y $& fooaAbBaAbBbBb
1214foo(?:aA)?+b fooaAb y $& fooaAb
1215foo(aA)?+b fooaAb y $& fooaAb
1216foo(aA|bB)?+b foobBb y $& foobBb
1217foo(?:aA|bB)?+b foobBb y $& foobBb
1218
1219([^()]++|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
1220round\(([^()]++)\) _I(round(xs * sz),1) y $1 xs * sz
1221
7f69552c
YO
1222(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $1 baz3
1223(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $& foo1bar2baz3y
1224(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $1 baz3
1225(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $& foo1bar2baz3y
1226
1227([yX].|WORDS|[yX].|WORD)S WORDS y $1 WORD
1228(WORDS|WORLD|WORD)S WORDS y $1 WORD
1229([yX].|WORDS|WORD|[xY].)S WORDS y $1 WORD
1230(foo|fool|[zx].|money|parted)$ fool y $1 fool
1231([zx].|foo|fool|[zq].|money|parted|[yx].)$ fool y $1 fool
1232(foo|fool|[zx].|money|parted)$ fools n - -
1233([zx].|foo|fool|[qx].|money|parted|[py].)$ fools n - -
1234
1235([yX].|WORDS|[yX].|WORD)+S WORDS y $1 WORD
1236(WORDS|WORLD|WORD)+S WORDS y $1 WORD
1237([yX].|WORDS|WORD|[xY].)+S WORDS y $1 WORD
1238(foo|fool|[zx].|money|parted)+$ fool y $1 fool
1239([zx].|foo|fool|[zq].|money|parted|[yx].)+$ fool y $1 fool
1240(foo|fool|[zx].|money|parted)+$ fools n - -
1241([zx].|foo|fool|[qx].|money|parted|[py].)+$ fools n - -
1242
1243(x|y|z[QW])+(longish|loquatious|excessive|overblown[QW])+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1244(x|y|z[QW])*(longish|loquatious|excessive|overblown[QW])* xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1245(x|y|z[QW]){1,5}(longish|loquatious|excessive|overblown[QW]){1,5} xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1246
1247(x|y|z[QW])++(longish|loquatious|excessive|overblown[QW])++ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1248(x|y|z[QW])*+(longish|loquatious|excessive|overblown[QW])*+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1249(x|y|z[QW]){1,5}+(longish|loquatious|excessive|overblown[QW]){1,5}+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1250
7f69552c 1251a*(?!) aaaab n - -
e2e6a0f1
YO
1252a*(*FAIL) aaaab n - -
1253a*(*F) aaaab n - -
1254
1255(A(A|B(*ACCEPT)|C)D)(E) AB y $1 AB
1256(A(A|B(*ACCEPT)|C)D)(E) ACDE y $1$2$3 ACDCE
1257
542fa716 1258(a)(?:(?-1)|(?+1))(b) aab y $&-$1-$2 aab-a-b
c74340f9 1259(a)(?:(?-1)|(?+1))(b) abb y $1-$2 a-b
542fa716 1260(a)(?:(?-1)|(?+1))(b) acb n - -
c74340f9 1261
2bf803e2
YO
1262(foo)(\g-2) foofoo y $1-$2 foo-foo
1263(foo)(\g-2)(foo)(\g-2) foofoofoofoo y $1-$2-$3-$4 foo-foo-foo-foo
1264(([abc]+) \g-1)(([abc]+) \g{-1}) abc abccba cba y $2-$4 abc-cba
1265(a)(b)(c)\g1\g2\g3 abcabc y $1$2$3 abc
1266
1f1031fe 1267# \k<n> preceded by a literal
99ed40ff 1268/(?'n'foo) \k<n>/ ..foo foo.. y $1 foo
cb6fa888 1269/(?'n'foo) \k<n>/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
99ed40ff 1270/(?<n>foo) \k'n'/ ..foo foo.. y $1 foo
cb6fa888
NC
1271/(?<n>foo) \k'n'/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1272/(?'a1'foo) \k'a1'/ ..foo foo.. yM $+{a1} foo miniperl cannot load Tie::Hash::NamedCapture
1273/(?<a1>foo) \k<a1>/ ..foo foo.. yM $+{a1} foo miniperl cannot load Tie::Hash::NamedCapture
1274/(?'_'foo) \k'_'/ ..foo foo.. yM $+{_} foo miniperl cannot load Tie::Hash::NamedCapture
1275/(?<_>foo) \k<_>/ ..foo foo.. yM $+{_} foo miniperl cannot load Tie::Hash::NamedCapture
1276/(?'_0_'foo) \k'_0_'/ ..foo foo.. yM $+{_0_} foo miniperl cannot load Tie::Hash::NamedCapture
1277/(?<_0_>foo) \k<_0_>/ ..foo foo.. yM $+{_0_} foo miniperl cannot load Tie::Hash::NamedCapture
0f7276ab
KW
1278/(?'0'foo) bar/ - c - Group name must start with a non-digit word character
1279/(?<0>foo) bar/ - c - Group name must start with a non-digit word character
1280/(?'12'foo) bar/ - c - Group name must start with a non-digit word character
1281/(?<12>foo) bar/ - c - Group name must start with a non-digit word character
1282/(?'1a'foo) bar/ - c - Group name must start with a non-digit word character
1283/(?<1a>foo) bar/ - c - Group name must start with a non-digit word character
1284/(?''foo) bar/ - c - Group name must start with a non-digit word character
1285/(?<>foo) bar/ - c - Group name must start with a non-digit word character
1286/foo \k'n'/ - c - Reference to nonexistent named group
1287/foo \k<n>/ - c - Reference to nonexistent named group
1288/foo \k'a1'/ - c - Reference to nonexistent named group
1289/foo \k<a1>/ - c - Reference to nonexistent named group
1290/foo \k'_'/ - c - Reference to nonexistent named group
1291/foo \k<_>/ - c - Reference to nonexistent named group
1292/foo \k'_0_'/ - c - Reference to nonexistent named group
1293/foo \k<_0_>/ - c - Reference to nonexistent named group
1294/foo \k'0'/ - c - Group name must start with a non-digit word character
1295/foo \k<0>/ - c - Group name must start with a non-digit word character
1296/foo \k'12'/ - c - Group name must start with a non-digit word character
1297/foo \k<12>/ - c - Group name must start with a non-digit word character
1298/foo \k'1a'/ - c - Group name must start with a non-digit word character
1299/foo \k<1a>/ - c - Group name must start with a non-digit word character
1300/foo \k''/ - c - Group name must start with a non-digit word character
1301/foo \k<>/ - c - Group name must start with a non-digit word character
99ed40ff 1302/(?<as>as) (\w+) \k<as> (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1f1031fe
YO
1303
1304# \g{...} with a name as the argument
1305/(?'n'foo) \g{n}/ ..foo foo.. y $1 foo
cb6fa888 1306/(?'n'foo) \g{n}/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe 1307/(?<n>foo) \g{n}/ ..foo foo.. y $1 foo
cb6fa888 1308/(?<n>foo) \g{n}/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1309/(?<as>as) (\w+) \g{as} (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1310
1311# Python style named capture buffer stuff
1312/(?P<n>foo)(?P=n)/ ..foofoo.. y $1 foo
cb6fa888
NC
1313/(?P<n>foo)(?P=n)/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1314/(?:(?P<n>foo)|(?P<n>bar))(?P=n)/ ..barbar.. yM $+{n} bar miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1315/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamimadam y $& madamimadam
1316/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamiamadam n - -
1317/(?P<n>foo) (?P=n)/ ..foo foo.. y $1 foo
cb6fa888 1318/(?P<n>foo) (?P=n)/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1319/(?P<as>as) (\w+) (?P=as) (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1320
1321#check that non identifiers as names are treated as the appropriate lookaround
1322(?<=bar>)foo bar>foo y $& foo
1323(?<!bar>)foo bar>foo n - -
1324(?<=bar>ABC)foo bar>ABCfoo y $& foo
1325(?<!bar>ABC)foo bar>ABCfoo n - -
1326(?<bar>)foo bar>ABCfoo y $& foo
68ba3a3f
YO
1327(?<bar>ABC)foo bar>ABCfoo y $& ABCfoo
1328
1329(?<=abcd(?<=(aaaabcd))) ..aaaabcd.. y $1 aaaabcd
1330(?=xy(?<=(aaxy))) ..aaxy.. y $1 aaxy
fae667d5
YO
1331
1332X(\w+)(?=\s)|X(\w+) Xab y [$1-$2] [-ab]
594d7033
YO
1333
1334#check that branch reset works ok.
3bce0506 1335(?|(a)) a y $1-$+-$^N a-a-a
594d7033
YO
1336(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) d!o!da y $1-$2-$3 !o!-o-a
1337(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) aabc y $1-$2-$3 a--c
1338(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) ixyjp y $1-$2-$3 x-y-p
1339(?|(?|(a)|(b))|(?|(c)|(d))) a y $1 a
1340(?|(?|(a)|(b))|(?|(c)|(d))) b y $1 b
1341(?|(?|(a)|(b))|(?|(c)|(d))) c y $1 c
1342(?|(?|(a)|(b))|(?|(c)|(d))) d y $1 d
1343(.)(?|(.)(.)x|(.)d)(.) abcde y $1-$2-$3-$4-$5- b-c--e--
cbf4a129 1344(\N)(?|(\N)(\N)x|(\N)d)(\N) abcde y $1-$2-$3-$4-$5- b-c--e--
cb6fa888
NC
1345(?|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1346(?|(?<foo>x)|(?<bar>y)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1347(?|(?<bar>y)|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1348(?<bar>)(?|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
fd4be6f0
FC
1349# Used to crash, because the last branch was ignored when the parens
1350# were counted:
1351(?|(b)|()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(a)) a y $& a
ee91d26e 1352
3e901dc0
YO
1353#Bug #41492
1354(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) a y $& a
1355(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) aa y $& aa
61525e55 1356\x{100}?(??{""})xxx xxx y $& xxx
e1d1eefb
YO
1357
1358foo(\R)bar foo\r\nbar y $1 \r\n
1359foo(\R)bar foo\nbar y $1 \n
1360foo(\R)bar foo\rbar y $1 \r
1361
1362foo(\R+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1363(\V+)(\R) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r\n
1364(\R+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1365foo(\R)bar foo\x{85}bar y $1 \x{85}
1366(\V)(\R) foo\x{85}bar y $1-$2 o-\x{85}
1367(\R)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1368foo(\R)bar foo\r\nbar y $1 \r\n
1369(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1370(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1371foo(\R)bar foo\r\nbar y $1 \r\n
1372(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1373(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1374foo(\R)bar foo\rbar y $1 \r
1375(\V)(\R) foo\rbar y $1-$2 o-\r
1376(\R)(\V) foo\rbar y $1-$2 \r-b
1377
1378foo(\v+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1379(\V+)(\v) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r
1380(\v+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1381foo(\v)bar foo\x{85}bar y $1 \x{85}
1382(\V)(\v) foo\x{85}bar y $1-$2 o-\x{85}
1383(\v)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1384foo(\v)bar foo\rbar y $1 \r
1385(\V)(\v) foo\rbar y $1-$2 o-\r
1386(\v)(\V) foo\rbar y $1-$2 \r-b
1387
1388
1389foo(\h+)bar foo\t\x{A0}bar y $1 \t\x{A0}
1390(\H+)(\h) foo\t\x{A0}bar y $1-$2 foo-\t
1391(\h+)(\H) foo\t\x{A0}bar y $1-$2 \t\x{A0}-b
1392foo(\h)bar foo\x{A0}bar y $1 \x{A0}
1393(\H)(\h) foo\x{A0}bar y $1-$2 o-\x{A0}
1394(\h)(\H) foo\x{A0}bar y $1-$2 \x{A0}-b
1395foo(\h)bar foo\tbar y $1 \t
1396(\H)(\h) foo\tbar y $1-$2 o-\t
1397(\h)(\H) foo\tbar y $1-$2 \t-b
5339e136 1398
cbf4a129
RGS
1399.*\z foo\n y -$&- --
1400\N*\z foo\n y -$&- --
1401.*\Z foo\n y -$&- -foo-
1402\N*\Z foo\n y -$&- -foo-
225593e1 1403^(?:(\d)x)?\d$ 1 y ${\(defined($1)?1:0)} 0
60f65011 1404.*?(?:(\w)|(\w))x abx y $1-$2 b-
639081d6
YO
1405
14060{50} 000000000000000000000000000000000000000000000000000 y - -
906cdd2b
HS
1407^a?(?=b)b ab y $& ab # Bug #56690
1408^a*(?=b)b ab y $& ab # Bug #56690
2811b836
B
1409/>\d+$ \n/ix >10\n y $& >10
1410/>\d+$ \n/ix >1\n y $& >1
1411/\d+$ \n/ix >10\n y $& 10
1412/>\d\d$ \n/ix >10\n y $& >10
1413/>\d+$ \n/x >10\n y $& >10
44d268c3
NC
1414
1415# Two regressions in 5.8.x (only) introduced by change 30638
1416# Simplification of the test failure in XML::LibXML::Simple:
1417/^\s*i.*?o\s*$/s io\n io y - -
1418# As reported in #59168 by Father Chrysostomos:
1419/(.*?)a(?!(a+)b\2c)/ baaabaac y $&-$1 baa-ba
aff3edb5
YO
1420# [perl #60344] Regex lookbehind failure after an (if)then|else in perl 5.10
1421/\A(?(?=db2)db2|\D+)(?<!processed)\.csv\z/xms sql_processed.csv n - -
24d786f4 1422/\N{U+0100}/ \x{100} y $& \x{100} # Bug #59328
ff3f963a
KW
1423/[a\N{U+0100}]/ \x{100} y $& \x{100}
1424/[a\N{U+0100}]/ a y $& a
1425
1426# Verify that \N{U+...} forces Unicode semantics
1427/\N{U+41}\x{c1}/i a\x{e1} y $& a\x{e1}
1428/[\N{U+41}\x{c1}]/i \x{e1} y $& \x{e1}
1429
11454c59 1430[\s][\S] \x{a0}\x{a0} n - - # Unicode complements should not match same character
3cf20fa2
KW
1431
1432# was generating malformed utf8
1433'[\x{100}\xff]'i \x{ff} y $& \x{ff}
e120390b
B
1434
1435((??{ "(?:|)" }))\s C\x20 y - -
40863337 1436
ff3f963a
KW
1437# Verify that \ escapes the { after \N, and causes \N to match non-newline
1438abc\N\{U+BEEF} abc\n{UBEEF} n
1439abc\N\{U+BEEF} abc.{UBEEF} y $& abc.{UBEEF}
1440[abc\N\{U+BEEF}] - c - \\N in a character class must be a named character
1441
1442# Verify that \N can be trailing and causes \N to match non-newline
1443abc\N abcd y $& abcd
1444abc\N abc\n n
1445
1446# Verify get errors. For these, we need // or else puts it in single quotes,
c3c41406 1447# and bypasses the lexer.
ff3f963a 1448/\N{U+}/ - c - Invalid hexadecimal number
c3c41406 1449# Below currently gives a misleading message
073b366a
KW
1450/[\N{U+}]/ - Sc - Unmatched
1451/[\N{U+}]/ - sc - Syntax error in (?[...])
ff3f963a 1452/abc\N{def/ - c - Missing right brace
c3c41406
KW
1453/\N{U+4AG3}/ - c - Illegal hexadecimal digit
1454/[\N{U+4AG3}]/ - c - Illegal hexadecimal digit
1455
1456# And verify that in single quotes which bypasses the lexer, the regex compiler
1457# figures it out.
1458\N{U+} - c - Invalid hexadecimal number
1459[\N{U+}] - c - Invalid hexadecimal number
b9c48b5b 1460\N{U+4AG3} - c - Invalid hexadecimal number
c3c41406
KW
1461[\N{U+4AG3}] - c - Invalid hexadecimal number
1462abc\N{def - c - \\N{NAME} must be resolved by the lexer
1463
1464# Verify that under /x that still cant have space before left brace
1465/abc\N {U+41}/x - c - Missing braces
1466/abc\N {SPACE}/x - c - Missing braces
ff3f963a
KW
1467
1468# Verifies catches hex errors, and doesn't expose our . notation to the outside
0b70ce6f
KW
1469/\N{U+0xBEEF}/ - c - Illegal hexadecimal digit
1470/\N{U+BEEF.BEAD}/ - c - Illegal hexadecimal digit
ff3f963a 1471
c3c41406
KW
1472# Verify works in single quotish context; regex compiler delivers slightly different msg
1473# \N{U+BEEF.BEAD} succeeds here, because can't completely hide it from the outside.
b9c48b5b 1474\N{U+0xBEEF} - c - Invalid hexadecimal number
17a3df4c
KW
1475\c` - c - \"\\c`\" is more clearly written simply as \"\\ \"
1476\c1 - c - \"\\c1\" is more clearly written simply as \"q\"
0b70ce6f 1477\cA \001 y $& \1
c3c41406 1478
fa1639c5
KW
1479\400 \x{100} y $& \x{100}
1480\600 \x{180} y $& \x{180}
1481\777 \x{1FF} y $& \x{1FF}
1482[a\400] \x{100} y $& \x{100}
1483[b\600] \x{180} y $& \x{180}
1484[c\777] \x{1FF} y $& \x{1FF}
f0a2b745
KW
1485\o{120} \x{50} y $& \x{50}
1486\o{400} \x{100} y $& \x{100}
1487\o{1000} \x{200} y $& \x{200}
1488[a\o{120}] \x{50} y $& \x{50}
1489[a\o{400}] \x{100} y $& \x{100}
1490[a\o{1000}] \x{200} y $& \x{200}
fa1639c5 1491
726ee55d 1492# The below were inserting a NULL
f1e1b256
YO
1493\87 87 c - Reference to nonexistent group in regex
1494a\87 a87 c - Reference to nonexistent group in regex
1495a\97 a97 c - Reference to nonexistent group in regex
726ee55d 1496
0c2990d6
DM
1497# avoid problems with 32-bit signed integer overflow
1498
1499(.)\g2147483648} x c - Reference to nonexistent group in regex
1500(.)\g2147483649} x c - Reference to nonexistent group in regex
1501(.)\g2147483650} x c - Reference to nonexistent group in regex
1502(.)\g4294967296} x c - Reference to nonexistent group in regex
1503(.)\g4294967297} x c - Reference to nonexistent group in regex
1504(.)\g4294967298} x c - Reference to nonexistent group in regex
1505a(.)\g2147483648} x c - Reference to nonexistent group in regex
1506a(.)\g2147483649} x c - Reference to nonexistent group in regex
1507a(.)\g2147483650} x c - Reference to nonexistent group in regex
1508a(.)\g4294967296} x c - Reference to nonexistent group in regex
1509a(.)\g4294967297} x c - Reference to nonexistent group in regex
1510a(.)\g4294967298} x c - Reference to nonexistent group in regex
1511
1512(.)\g{2147483648} x c - Reference to nonexistent group in regex
1513(.)\g{2147483649} x c - Reference to nonexistent group in regex
1514(.)\g{2147483650} x c - Reference to nonexistent group in regex
1515(.)\g{4294967296} x c - Reference to nonexistent group in regex
1516(.)\g{4294967297} x c - Reference to nonexistent group in regex
1517(.)\g{4294967298} x c - Reference to nonexistent group in regex
1518a(.)\g{2147483648} x c - Reference to nonexistent group in regex
1519a(.)\g{2147483649} x c - Reference to nonexistent group in regex
1520a(.)\g{2147483650} x c - Reference to nonexistent group in regex
1521a(.)\g{4294967296} x c - Reference to nonexistent group in regex
1522a(.)\g{4294967297} x c - Reference to nonexistent group in regex
1523a(.)\g{4294967298} x c - Reference to nonexistent group in regex
1524
1525(.)\2147483648 b\o{214}7483648 y $1 b
1526(.)\2147483649 b\o{214}7483649 y $1 b
1527(.)\2147483650 b\o{214}7483650 y $1 b
1528(.)\4294967296 b\o{42}94967296 y $1 b
1529(.)\4294967297 b\o{42}94967297 y $1 b
1530(.)\4294967298 b\o{42}94967298 y $1 b
1531a(.)\2147483648 ab\o{214}7483648 y $1 b
1532a(.)\2147483649 ab\o{214}7483649 y $1 b
1533a(.)\2147483650 ab\o{214}7483650 y $1 b
1534a(.)\4294967296 ab\o{42}94967296 y $1 b
1535a(.)\4294967297 ab\o{42}94967297 y $1 b
1536a(.)\4294967298 ab\o{42}94967298 y $1 b
1537
c99e91e9 1538# The below was inserting a NULL into the character class.
073b366a
KW
1539[\8\9] \000 Sn - -
1540[\8\9] - sc $& Unrecognized escape \\8 in character class
1541[\8\9] 8 Sy $& 8
1542[\8\9] 9 Sy $& 9
c99e91e9
KW
1543
1544# Verify that reads 1-3 octal digits, and that \_ works in char class
073b366a
KW
1545[\0] \000 Sy $& \000
1546[\0] - sc - Need exactly 3 octal digits
1547[\07] \007 Sy $& \007
1548[\07] - sc - Need exactly 3 octal digits
1549[\07] 7\000 Sn - -
1550[\07] - sc - Need exactly 3 octal digits
c99e91e9
KW
1551[\006] \006 y $& \006
1552[\006] 6\000 n - -
1553[\0005] \0005 y $& \000
1554[\0005] 5\000 y $& 5
1555[\_] _ y $& _
1556
779bcb7d
NC
1557# RT #79152
1558(q1|.)*(q2|.)*(x(a|bc)*y){2,} xayxay y $& xayxay
1559(q1|.)*(q2|.)*(x(a|bc)*y){2,3} xayxay y $& xayxay
1560(q1|z)*(q2|z)*z{15}-.*?(x(a|bc)*y){2,3}Z zzzzzzzzzzzzzzzz-xayxayxayxayZ y $& zzzzzzzzzzzzzzzz-xayxayxayxayZ
1561
20dbff7c 1562(?:(?:)foo|bar|zot|rt78356) foo y $& foo
e40e74fe 1563/\xe0\pL/i \xc0a y $& \xc0a
1411dba4
KW
1564
1565# RT #85528
1566(?{})[\x{100}] \x{100} y $& \x{100}
6241f69e
KW
1567
1568# RT #85964
af302e7f 1569^m?(\S)(.*)\1$ aba y $1 a
6241f69e 1570^m?(\S)(.*)\1$ \tb\t n - -
af302e7f 1571^m?(\s)(.*)\1$ \tb\t y $1 \t
6241f69e 1572^m?(\s)(.*)\1$ aba n - -
af302e7f 1573^m?(\W)(.*)\1$ :b: y $1 :
6241f69e 1574^m?(\W)(.*)\1$ aba n - -
af302e7f 1575^m?(\w)(.*)\1$ aba y $1 a
6241f69e 1576^m?(\w)(.*)\1$ :b: n - -
af302e7f 1577^m?(\D)(.*)\1$ aba y $1 a
6241f69e 1578^m?(\D)(.*)\1$ 5b5 n - -
af302e7f 1579^m?(\d)(.*)\1$ 5b5 y $1 5
6241f69e 1580^m?(\d)(.*)\1$ aba n - -
f6a766d5
KW
1581
1582# 17F is 'Long s'; This makes sure the a's in /aa can be separate
1583/s/ai \x{17F} y $& \x{17F}
1584/s/aia \x{17F} n - -
1585/s/aia S y $& S
1586/(?aia:s)/ \x{17F} n - -
1587/(?aia:s)/ S y $& S
827f5bb8
KW
1588
1589# Normally 1E9E generates a multi-char fold, but not in inverted class;
1590# See [perl #89750]. This makes sure that the simple fold gets generated
1591# in that case, to DF.
073b366a 1592/[^\x{1E9E}]/i \x{DF} Sn - -
1380b51d
DM
1593
1594# RT #96354
1595/^.*\d\H/ X1 n - -
1596/^.*\d\V/ X1 n - -
1597
45376db6
KW
1598# \p{L_} was being misinterpreted as \p{L}. L_ matches cased letters, which
1599# the ideograph below isn't, whereas it does match L
1600/^\p{L_}/ \x{3400} n - -
1601/^\p{L}/ \x{3400} y $& \x{3400}
1602
fd0f00a9 1603# RT #89774
073b366a 1604/[s\xDF]a/ui ssa Sy $& ssa
9d53c457 1605/[s\xDF]a/ui sa y $& sa
fd0f00a9 1606
e47f2755 1607# RT #99928
1978b668 1608/^\R\x0A$/ \x0D\x0A n - -
e47f2755 1609
7b8a8069 1610/ff/i \x{FB00}\x{FB01} y $& \x{FB00}
7c1b9f38 1611/ff/i \x{FB01}\x{FB00} y $& \x{FB00}
7b8a8069 1612/fi/i \x{FB01}\x{FB00} y $& \x{FB01}
7c1b9f38 1613/fi/i \x{FB00}\x{FB01} y $& \x{FB01}
2866decb
DM
1614#
1615# Make sure we don't see code blocks where there aren't, and vice-versa
1616(?#( (?{1+)a a y - -
1617'a# (?{1+'x a y - -
1618ab[(?{1] ab1 y - -
1619ab[(?{1\](?{2] ab2 y - -
1620ab(?{"["})cd abcd y - -
e4a2df84
DM
1621ab(??{"[x]"})cd abxcd y - -
1622ab\[(??{1})c ab[1c y - -
1623ab\\[(??{1;})]c ab\\;c y - -
1624ab\\\[(??{1})c ab\\[1c y - -
1625ab[c\](??{"]d abcd y - -
1626ab[c\\](??{"[x]"})d ab\\xd y - -
1627ab[c\\\](??{"x"})]{3}d ab\\](d y - -
7b8a8069 1628
e067297c
KW
1629# These test that doesn't cut-off matching too soon in the string for
1630# multi-char folds
1631/ffiffl/i abcdef\x{FB03}\x{FB04} y $& \x{FB03}\x{FB04}
1632/\xdf\xdf/ui abcdefssss y $& ssss
1633
7a2d0ccc
KW
1634/st/i \x{DF}\x{FB05} y $& \x{FB05}
1635/ssst/i \x{DF}\x{FB05} y $& \x{DF}\x{FB05}
88b3a463
KW
1636/[s]s/i \x{DF} n - -
1637/s[s]/i \x{DF} n - -
7a2d0ccc 1638
4f03b4b6
KW
1639# [perl #101970]
1640/[[:lower:]]/i \x{100} y $& \x{100}
1641/[[:upper:]]/i \x{101} y $& \x{101}
1642
ed178f65
KW
1643# Was matching 'ss' only and failing the entire match, not seeing the
1644# alternative that would succeed
bb914485
KW
1645/s\xDF/ui \xDFs y $& \xDFs
1646/sst/ui s\N{LATIN SMALL LIGATURE ST} y $& s\N{LATIN SMALL LIGATURE ST}
1647/sst/ui s\N{LATIN SMALL LIGATURE LONG S T} y $& s\N{LATIN SMALL LIGATURE LONG S T}
ed178f65 1648
35245af4 1649# /i properties shouldn't match more than the property itself
ea317ccb
KW
1650/[[:ascii:]]/i \N{KELVIN SIGN} n - -
1651
dab0c3e7
KW
1652# [[:lower:]]/i and [[:upper:]]/i should match what \p{Lower} and \p{Upper} do.
1653# which is \p{Cased}, not \p{Alpha},
1654/[[:lower:]]/i \N{U+3400} n - -
1655/[[:upper:]]/i \N{U+01BB} n - -
1656
5d103fec
KW
1657# [perl #110648]
1658[^\p{Alphabetic}] \x{100} n - -
1659
b4069bca
KW
1660# [perl #111400]. Tests the first Y/N boundary above 255 for each of these.
1661/[[:alnum:]]/ \x{2c1} y - -
1662/[[:alnum:]]/ \x{2c2} n - -
1663/[[:alpha:]]/ \x{2c1} y - -
1664/[[:alpha:]]/ \x{2c2} n - -
1665/[[:graph:]]/ \x{377} y - -
1666/[[:graph:]]/ \x{378} n - -
1667/[[:lower:]]/ \x{100} n - -
1668/[[:lower:]]/ \x{101} y - -
1669/[[:lower:]]/ \x{102} n - -
1670/[[:print:]]/ \x{377} y - -
1671/[[:print:]]/ \x{378} n - -
1672/[[:punct:]]/ \x{37D} n - -
1673/[[:punct:]]/ \x{37E} y - -
1674/[[:punct:]]/ \x{388} n - -
1675/[[:upper:]]/ \x{100} y - -
1676/[[:upper:]]/ \x{101} n - -
1677/[[:word:]]/ \x{2c1} y - -
1678/[[:word:]]/ \x{2c2} n - -
1679
4adb7801
FC
1680# [perl #113400]
1681/syntax OK\s+\z/si t/bin/good.pl syntax OK\n y - -
b4069bca 1682
df826430
YO
1683/^(.*?)\s*\|\s*(?:\/\s*|)'(.+)'$/ text|'sec' y <$1><$2> <text><sec>
1684/^(foo|)bar$/ bar y <$&> <bar>
1685/^(foo||baz)bar$/ bar y <$&> <bar>
1686/^(foo||baz)bar$/ bazbar y <$1> <baz>
1687/^(foo||baz)bar$/ foobar y <$1> <foo>
1688
1689/^(?:foo|)bar$/ bar y <$&> <bar>
1690/^(?:foo||baz)bar$/ bar y <$&> <bar>
1691/^(?:foo||baz)bar$/ bazbar y <$&> <bazbar>
1692/^(?:foo||baz)bar$/ foobar y <$&> <foobar>
1693
1694/^(?i:foo|)bar$/ bar y <$&> <bar>
1695/^(?i:foo||baz)bar$/ bar y <$&> <bar>
1696/^(?i:foo||baz)bar$/ bazbar y <$&> <bazbar>
1697/^(?i:foo||baz)bar$/ foobar y <$&> <foobar>
1698
f6033a9d
DM
1699# $^N, $+ on backtrackracking
1700# BRANCH
1701^(.)(?:(..)|B)[CX] ABCDE y $^N-$+ A-A -
1702# TRIE
1703^(.)(?:BC(.)|B)[CX] ABCDE y $^N-$+ A-A -
1704# CURLYX
1705^(.)(?:(.)+)*[BX] ABCDE y $^N-$+ A-A -
1706# CURLYM
1707^(.)(BC)* ABCDE y $^N-$+ BC-BC -
1708^(.)(BC)*[BX] ABCDE y $^N-$+ A-A -
1709# CURLYN
1710^(.)(B)*.[DX] ABCDE y $^N-$+ B-B -
1711^(.)(B)*.[CX] ABCDE y $^N-$+ A-A -
1712
cec72654
DM
1713# using 'return' in code blocks
1714^(A)(?{"xyz"})B$ AB y $1-$^R A-xyz -
1715^(A)(?{return "xyz"})B$ AB y $1-$^R A-xyz -
1716^(A)((??{"xyz"}))$ Axyz y $1-$2 A-xyz -
1717^(A)((??{return "xyz"}))$ Axyz y $1-$2 A-xyz -
1718^(A)((?(?{1})abc|xyz))$ Aabc y $1-$2 A-abc -
1719^(A)((?(?{0})abc|xyz))$ Axyz y $1-$2 A-xyz -
1720^(A)((?(?{return 1})abc|xyz))$ Aabc y $1-$2 A-abc -
1721^(A)((?(?{return 0})abc|xyz))$ Axyz y $1-$2 A-xyz -
1722
ec841a27
DM
1723# pattern modifier flags should propagate into returned (??{}) pattern
1724# p,d,l not tested
1725
1726/^(a)((??{"b"}))$/i AB y $1-$2 A-B -
1727/^(A)((??{'B$'}))(\nC)$/m AB\nC y $1-$2-$3 A-B-\nC -
1728/^(A)((??{'.'}))(B)$/s A\nB y $1-$2-$3 A-\n-B -
1729/^(A) ((??{' .'}))(B)$/x A B y $1-$2-$3 A- -B -
1730/^((??{'\d'}))$/a \x{660} n - -
1731/^(??{"s"})$/i \x{17F} y - -
1732/^(??{"s"})$/ia \x{17F} y - -
1733/^(??{"s"})$/iaa \x{17F} n - -
1734/^(??{'\w'})$/u \x{AA} y - -
1735
a8d1f4b4
DM
1736# #113670 ensure any captures to the right are invalidated when CURLY
1737# and CURLYM backtrack
1738
1739^(?:(X)?(\d)|(X)?(\d\d))$ X12 y $1-$2-$3-$4 --X-12
1740^(?:(XX)?(\d)|(XX)?(\d\d))$ XX12 y $1-$2-$3-$4 --XX-12
1741
190c1910
YO
1742# rt 113770
1743\A(?>\[(?:(?:)(?:R){1}|T|V?|A)\])\z [A] y $& [A]
ac7af3f6
YO
1744# rt 114068
1745/( [^z] $ [^z]+)/xm aa\nbb\ncc\n y $1 a\nbb\ncc\n
d8661376
KW
1746
1747# [perl #114220]
1748/[\h]/ \x{A0} y $& \xA0
1749/[\H]/ \x{BF} y $& \xBF
1750/[\H]/ \x{A0} n - -
1751/[\H]/ \x{A1} y $& \xA1
1752
5a279aa0
KW
1753[^\n]+ \nb y $& b
1754[^\n]+ a\n y $& a
1755
0658cdde
KW
1756# /a has no effect on properties
1757(?a:\p{Any}) \x{100} y $& \x{100}
1758(?aa:\p{Any}) \x{100} y $& \x{100}
1759
7a4d6ad6
KW
1760\w \x{200C} y $& \x{200C}
1761\W \x{200C} n - -
1762\w \x{200D} y $& \x{200D}
1763\W \x{200D} n - -
1764
7dff6b46 1765/^(?d:\xdf|_)*_/i \x{17f}\x{17f}_ y $& \x{17f}\x{17f}_
6502e081
DM
1766#
1767# check that @-, @+ count chars, not bytes; especially if beginning of
1768# string is not copied
1769
1770(\x{100}) \x{2000}\x{2000}\x{2000}\x{100} y $-[0]:$-[1]:$+[0]:$+[1] 3:3:4:4
7dff6b46 1771
565fc1bb
KW
1772^\R{2}$ \r\n\r\n y $& \r\n\r\n
1773
4063ade8
KW
1774/^\D{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1775/^\S{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1776/^\W{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1777
d87fc68d 1778# [ perl #114272]
41043df0 1779\Vn \xFFn/ y $& \xFFn
d87fc68d 1780
709d08c2 1781# These mostly exercize various paths in the optimizer
b25a1036 1782/(?l:a?\w)/ b y $& b
709d08c2
KW
1783/(?l:a?\D)/ b y $& b
1784^_?[^\S_0-9]\w*\z \t y $& \t
4d68ffa0 1785m?^xy\?$? xy? y $& xy?
709d08c2
KW
1786a?\X a\x{100} y $& a\x{100}
1787a?\R a\n y $& a\n
1788^a?\N$ a\n y $& a
1789\N?a \na y $& a
1790/\s?\s/l \t y $& \t
1791/\s?\d/l 3 y $& 3
1792/\s?\S/l A y $& A
b25a1036 1793
aed7b151
DM
1794# check we have the right utf8ness as we switch back and forth between
1795# patterns
1796^(\x{100}|a)(??{ qr/.?\xF7/d}) a_\xF7 y - -
1797
c37d14f9
KW
1798# [perl #118375]
1799/(a|(bc)){0,0}?xyz/ xyz y $& xyz
1800/( a | ( bc ) ) {0,0} ? xyz/x xyz y $& xyz
1801
b75763d6
YO
1802/(a|(bc)){0,0}+xyz/ xyz y $& xyz
1803/( a | ( bc ) ) {0,0} + xyz/x xyz y $& xyz
1804
5c53df94
YO
1805(A(*PRUNE)B|A(*PRUNE)C) AC n - -
1806(A(*PRUNE)B|A(*PRUNE)D|A(*PRUNE)C) AC n - -
1807(A(*PRUNE)B|A(*PRUNE)C|A(*PRUNE)D) AC n - -
1808((A(*PRUNE)B|A(*PRUNE)C)) AC n - -
1809((A(*PRUNE)B|A(*PRUNE)D|A(*PRUNE)C)) AC n - -
1810((A(*PRUNE)B|A(*PRUNE)C|A(*PRUNE)D)) AC n - -
1811
b8f6efdd
YO
1812A+?(*THEN)BC AAABC y $& ABC
1813A+?(*PRUNE)BC AAABC y $& ABC
1814A+(*THEN)BC AAABC y $& AAABC
1815A+(*PRUNE)BC AAABC y $& AAABC
1816A+?(*THEN)BC(?{}) AAABC y $& ABC
1817A+?(*PRUNE)BC(?{}) AAABC y $& ABC
1818A+(*THEN)BC(?{}) AAABC y $& AAABC
1819A+(*PRUNE)BC(?{}) AAABC y $& AAABC
c30fc27b
DM
1820/[#]/ a#b y $& #
1821/[#]b/ a#b y $& #b
1822/[#]/x a#b y $& #
1823/[#]b/x a#b y $& #b
1824/[#](?{})/x a#b y $& #
1825/[#](??{'b'})/x a#b y $& #b
1826/(?#)(?{})b/ a#b y $& b
1827/(?#)(??{'b'})/ a#b y $& b
1828/[(?#](?{})b/ a#b y $& #b
1829/[(?#](??{'b'})/ a#b y $& #b
1830/(?#)(?{})b/x a#b y $& b
1831/(?#)(??{'b'})/x a#b y $& b
602afc9b 1832
c5de0829
JK
1833# RT #119069: PCRE regression test: no segfault
1834^(?=(a)){0}b(?1) back y $& ba
1835# RT #119071: PCRE regression test: No warning of infinite regression
1836(?:(a(*SKIP)b)){0}(?:(?1)|ac) x n - -
1837# RT #119073: PCRE regression test: {0} => NOTHING optimization
1838(?1)(?:(b)){0} b y $& b
77ebeeba
KW
1839# RT #120041
1840^A*\z y $&
8ee4c05d
KW
1841/\N* /x ab y $& ab # Under /x was ignoring the '*'
1842/\N (?#comment) * /x ab y $& ab # likewise
602afc9b 1843
099ec7dc
YO
1844# RT #120600: Variable length lookbehind is not variable
1845(?<W>a)(?<BB>(?=(?&W))(?<=(?&W)))(?&BB) aa y $& a # test repeated recursive patterns
602afc9b
KW
1846# Keep these lines at the end of the file
1847# vim: softtabstop=0 noexpandtab