This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don't try to compile a pattern known to be in error
[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 - -
139a998a
KW
137\b n - -
138\b{gcb} n - -
6b659339 139\b{lb} n - -
139a998a
KW
140\b{sb} n - -
141\b{wb} n - -
142\B y - -
143\B{gcb} y - -
6b659339 144\B{lb} y - -
139a998a
KW
145\B{sb} y - -
146\B{wb} y - -
bbce6d69
PP
147\w a y - -
148\w - n - -
149\W a n - -
150\W - y - -
151a\sb a b y - -
152a\sb a-b n - -
153a\Sb a b n - -
154a\Sb a-b y - -
155\d 1 y - -
156\d - n - -
157\D 1 n - -
158\D - y - -
159[\w] a y - -
160[\w] - n - -
161[\W] a n - -
162[\W] - y - -
163a[\s]b a b y - -
164a[\s]b a-b n - -
165a[\S]b a b n - -
166a[\S]b a-b y - -
167[\d] 1 y - -
168[\d] - n - -
169[\D] 1 n - -
170[\D] - y - -
378cc40b
LW
171ab|cd abc y $& ab
172ab|cd abcd y $& ab
173()ef def y $&-$1 ef-
301f462a
MJD
174()ef def y $-[0] 1
175()ef def y $+[0] 3
3de645a8 176()\x{100}\x{1000} d\x{100}\x{1000} y $+[0] 3
301f462a
MJD
177()ef def y $-[1] 1
178()ef def y $+[1] 1
24b61696 179*a - c - Quantifier follows nothing
e2e6a0f1
YO
180(|*)b - c - Quantifier follows nothing
181(*)b - c - Unknown verb
378cc40b 182$b b n - -
1b1626e4 183a\ - c - Search pattern not terminated
378cc40b
LW
184a\(b a(b y $&-$1 a(b-
185a\(*b ab y $& ab
186a\(*b a((b y $& a((b
b2a156bd 187a\\b a\\b y $& a\\b
24b61696
RK
188abc) - c - Unmatched )
189(abc - c - Unmatched (
378cc40b 190((a)) abc y $&-$1-$2 a-a-a
301f462a
MJD
191((a)) abc y $-[0]-$-[1]-$-[2] 0-0-0
192((a)) abc y $+[0]-$+[1]-$+[2] 1-1-1
193((a)) abc b @- 0 0 0
194((a)) abc b @+ 1 1 1
378cc40b 195(a)b(c) abc y $&-$1-$2 abc-a-c
301f462a
MJD
196(a)b(c) abc y $-[0]-$-[1]-$-[2] 0-0-2
197(a)b(c) abc y $+[0]-$+[1]-$+[2] 3-1-3
378cc40b 198a+b+c aabbabc y $& abc
a687059c 199a{1,}b{1,}c aabbabc y $& abc
24b61696 200a** - c - Nested quantifiers
a0d0e21e 201a.+?c abcabc y $& abc
378cc40b 202(a+|b)* ab y $&-$1 ab-b
301f462a
MJD
203(a+|b)* ab y $-[0] 0
204(a+|b)* ab y $+[0] 2
205(a+|b)* ab y $-[1] 1
206(a+|b)* ab y $+[1] 2
a687059c 207(a+|b){0,} ab y $&-$1 ab-b
378cc40b 208(a+|b)+ ab y $&-$1 ab-b
a687059c 209(a+|b){1,} ab y $&-$1 ab-b
378cc40b 210(a+|b)? ab y $&-$1 a-a
a687059c 211(a+|b){0,1} ab y $&-$1 a-a
24b61696 212)( - c - Unmatched )
378cc40b
LW
213[^ab]* cde y $& cde
214abc n - -
215a* y $&
216([abc])*d abbbcd y $&-$1 abbbcd-c
217([abc])*bcd abcd y $&-$1 abcd-a
218a|b|c|d|e e y $& e
219(a|b|c|d|e)f ef y $&-$1 ef-e
301f462a
MJD
220(a|b|c|d|e)f ef y $-[0] 0
221(a|b|c|d|e)f ef y $+[0] 2
222(a|b|c|d|e)f ef y $-[1] 0
223(a|b|c|d|e)f ef y $+[1] 1
378cc40b
LW
224abcd*efg abcdefg y $& abcdefg
225ab* xabyabbbz y $& ab
226ab* xayabbbz y $& a
227(ab|cd)e abcde y $&-$1 cde-cd
228[abhgefdc]ij hij y $& hij
229^(ab|cd)e abcde n x$1y xy
230(abc|)ef abcdef y $&-$1 ef-
231(a|b)c*d abcd y $&-$1 bcd-b
232(ab|ab*)bc abc y $&-$1 abc-a
233a([bc]*)c* abc y $&-$1 abc-bc
234a([bc]*)(c*d) abcd y $&-$1-$2 abcd-bc-d
301f462a
MJD
235a([bc]*)(c*d) abcd y $-[0] 0
236a([bc]*)(c*d) abcd y $+[0] 4
237a([bc]*)(c*d) abcd y $-[1] 1
238a([bc]*)(c*d) abcd y $+[1] 3
239a([bc]*)(c*d) abcd y $-[2] 3
240a([bc]*)(c*d) abcd y $+[2] 4
378cc40b
LW
241a([bc]+)(c*d) abcd y $&-$1-$2 abcd-bc-d
242a([bc]*)(c+d) abcd y $&-$1-$2 abcd-b-cd
301f462a
MJD
243a([bc]*)(c+d) abcd y $-[0] 0
244a([bc]*)(c+d) abcd y $+[0] 4
245a([bc]*)(c+d) abcd y $-[1] 1
246a([bc]*)(c+d) abcd y $+[1] 2
247a([bc]*)(c+d) abcd y $-[2] 2
248a([bc]*)(c+d) abcd y $+[2] 4
378cc40b
LW
249a[bcd]*dcdcde adcdcde y $& adcdcde
250a[bcd]+dcdcde adcdcde n - -
251(ab|a)b*c abc y $&-$1 abc-ab
301f462a
MJD
252(ab|a)b*c abc y $-[0] 0
253(ab|a)b*c abc y $+[0] 3
254(ab|a)b*c abc y $-[1] 0
255(ab|a)b*c abc y $+[1] 2
378cc40b 256((a)(b)c)(d) abcd y $1-$2-$3-$4 abc-a-b-d
301f462a
MJD
257((a)(b)c)(d) abcd y $-[0] 0
258((a)(b)c)(d) abcd y $+[0] 4
259((a)(b)c)(d) abcd y $-[1] 0
260((a)(b)c)(d) abcd y $+[1] 3
261((a)(b)c)(d) abcd y $-[2] 0
262((a)(b)c)(d) abcd y $+[2] 1
263((a)(b)c)(d) abcd y $-[3] 1
264((a)(b)c)(d) abcd y $+[3] 2
265((a)(b)c)(d) abcd y $-[4] 3
266((a)(b)c)(d) abcd y $+[4] 4
378cc40b 267[a-zA-Z_][a-zA-Z0-9_]* alpha y $& alpha
6dd6e9f9 268[_A-Z] } n - - # This could match on EBCDIC if A-Z not excluding things in middle
378cc40b
LW
269^a(bc+|b[eh])g|.h$ abh y $&-$1 bh-
270(bc+d$|ef*g.|h?i(j|k)) effgz y $&-$1-$2 effgz-effgz-
271(bc+d$|ef*g.|h?i(j|k)) ij y $&-$1-$2 ij-ij-j
272(bc+d$|ef*g.|h?i(j|k)) effg n - -
273(bc+d$|ef*g.|h?i(j|k)) bcdd n - -
274(bc+d$|ef*g.|h?i(j|k)) reffgz y $&-$1-$2 effgz-effgz-
fe14fcc3 275((((((((((a)))))))))) a y $10 a
301f462a
MJD
276((((((((((a)))))))))) a y $-[0] 0
277((((((((((a)))))))))) a y $+[0] 1
278((((((((((a)))))))))) a y $-[10] 0
279((((((((((a)))))))))) a y $+[10] 1
fe14fcc3 280((((((((((a))))))))))\10 aa y $& aa
9d116dd7
JH
281((((((((((a))))))))))${bang} aa n - -
282((((((((((a))))))))))${bang} a! y $& a!
378cc40b
LW
283(((((((((a))))))))) a y $& a
284multiple words of text uh-uh n - -
285multiple words multiple words, yeah y $& multiple words
286(.*)c(.*) abcde y $&-$1-$2 abcde-ab-de
287\((.*), (.*)\) (a, b) y ($2, $1) (b, a)
288[k] ab n - -
b2a156bd
DM
289abcd abcd y $&-\$&-\\$& abcd-\$&-\\abcd
290a(bc)d abcd y $1-\$1-\\$1 bc-\$1-\\bc
378cc40b
LW
291a[-]?c ac y $& ac
292(abc)\1 abcabc y $1 abc
293([a-c]*)\1 abcabc y $1 abc
9baa0206
HS
294\1 - c - Reference to nonexistent group
295\2 - c - Reference to nonexistent group
88307081
RGS
296\g1 - c - Reference to nonexistent group
297\g-1 - c - Reference to nonexistent or unclosed group
298\g{1} - c - Reference to nonexistent group
299\g{-1} - c - Reference to nonexistent or unclosed group
300\g0 - c - Reference to invalid group 0
301\g-0 - c - Reference to invalid group 0
302\g{0} - c - Reference to invalid group 0
303\g{-0} - c - Reference to invalid group 0
ef64f398 304(a)|\1 a y - -
40863337
ML
305(a)|\1 x n - Reference to group in different branch
306(?:(b)?a)\1 a n - Reference to group that did not match
9baa0206 307(a)|\2 - c - Reference to nonexistent group
ef64f398
HS
308(([a-c])b*?\2)* ababbbcbc y $&-$1-$2 ababb-bb-b
309(([a-c])b*?\2){3} ababbbcbc y $&-$1-$2 ababbbcbc-cbc-c
310((\3|b)\2(a)x)+ aaxabxbaxbbx n - -
311((\3|b)\2(a)x)+ aaaxabaxbaaxbbax y $&-$1-$2-$3 bbax-bbax-b-a
312((\3|b)\2(a)){2,} bbaababbabaaaaabbaaaabba y $&-$1-$2-$3 bbaaaabba-bba-b-a
ee1d8f2a
RU
313#Bug #3589 - up to perl-5.6.0 matches incorrectly, from 5.6.1 not anymore
314^((.)?a\2)+$ babadad n - -
301f462a
MJD
315(a)|(b) b y $-[0] 0
316(a)|(b) b y $+[0] 1
317(a)|(b) b y x$-[1] x
318(a)|(b) b y x$+[1] x
319(a)|(b) b y $-[2] 0
320(a)|(b) b y $+[2] 1
1462b684
LW
321'abc'i ABC y $& ABC
322'abc'i XBC n - -
323'abc'i AXC n - -
324'abc'i ABX n - -
325'abc'i XABCY y $& ABC
326'abc'i ABABC y $& ABC
327'ab*c'i ABC y $& ABC
328'ab*bc'i ABC y $& ABC
329'ab*bc'i ABBC y $& ABBC
a0d0e21e
LW
330'ab*?bc'i ABBBBC y $& ABBBBC
331'ab{0,}?bc'i ABBBBC y $& ABBBBC
332'ab+?bc'i ABBC y $& ABBC
1462b684
LW
333'ab+bc'i ABC n - -
334'ab+bc'i ABQ n - -
335'ab{1,}bc'i ABQ n - -
336'ab+bc'i ABBBBC y $& ABBBBC
a0d0e21e
LW
337'ab{1,}?bc'i ABBBBC y $& ABBBBC
338'ab{1,3}?bc'i ABBBBC y $& ABBBBC
339'ab{3,4}?bc'i ABBBBC y $& ABBBBC
340'ab{4,5}?bc'i ABBBBC n - -
341'ab??bc'i ABBC y $& ABBC
342'ab??bc'i ABC y $& ABC
343'ab{0,1}?bc'i ABC y $& ABC
344'ab??bc'i ABBBBC n - -
345'ab??c'i ABC y $& ABC
346'ab{0,1}?c'i ABC y $& ABC
1462b684
LW
347'^abc$'i ABC y $& ABC
348'^abc$'i ABCC n - -
349'^abc'i ABCC y $& ABC
350'^abc$'i AABC n - -
351'abc$'i AABC y $& ABC
352'^'i ABC y $&
353'$'i ABC y $&
354'a.c'i ABC y $& ABC
355'a.c'i AXC y $& AXC
afefe6bf 356'a\Nc'i ABC y $& ABC
a0d0e21e 357'a.*?c'i AXYZC y $& AXYZC
1462b684
LW
358'a.*c'i AXYZD n - -
359'a[bc]d'i ABC n - -
360'a[bc]d'i ABD y $& ABD
361'a[b-d]e'i ABD n - -
362'a[b-d]e'i ACE y $& ACE
363'a[b-d]'i AAC y $& AC
364'a[-b]'i A- y $& A-
365'a[b-]'i A- y $& A-
073b366a 366'a[b-a]'i - c - Invalid [] range
24b61696
RK
367'a[]b'i - c - Unmatched [
368'a['i - c - Unmatched [
1462b684
LW
369'a]'i A] y $& A]
370'a[]]b'i A]B y $& A]B
371'a[^bc]d'i AED y $& AED
372'a[^bc]d'i ABD n - -
373'a[^-b]c'i ADC y $& ADC
374'a[^-b]c'i A-C n - -
375'a[^]b]c'i A]C n - -
376'a[^]b]c'i ADC y $& ADC
377'ab|cd'i ABC y $& AB
378'ab|cd'i ABCD y $& AB
379'()ef'i DEF y $&-$1 EF-
24b61696 380'*a'i - c - Quantifier follows nothing
e2e6a0f1
YO
381'(|*)b'i - c - Quantifier follows nothing
382'(*)b'i - c - Unknown verb
1462b684 383'$b'i B n - -
1b1626e4 384'a\'i - c - Search pattern not terminated
1462b684
LW
385'a\(b'i A(B y $&-$1 A(B-
386'a\(*b'i AB y $& AB
387'a\(*b'i A((B y $& A((B
b2a156bd 388'a\\b'i A\\B y $& A\\B
24b61696
RK
389'abc)'i - c - Unmatched )
390'(abc'i - c - Unmatched (
1462b684
LW
391'((a))'i ABC y $&-$1-$2 A-A-A
392'(a)b(c)'i ABC y $&-$1-$2 ABC-A-C
393'a+b+c'i AABBABC y $& ABC
394'a{1,}b{1,}c'i AABBABC y $& ABC
24b61696 395'a**'i - c - Nested quantifiers
a0d0e21e
LW
396'a.+?c'i ABCABC y $& ABC
397'a.*?c'i ABCABC y $& ABC
398'a.{0,5}?c'i ABCABC y $& ABC
1462b684
LW
399'(a+|b)*'i AB y $&-$1 AB-B
400'(a+|b){0,}'i AB y $&-$1 AB-B
401'(a+|b)+'i AB y $&-$1 AB-B
402'(a+|b){1,}'i AB y $&-$1 AB-B
403'(a+|b)?'i AB y $&-$1 A-A
404'(a+|b){0,1}'i AB y $&-$1 A-A
a0d0e21e 405'(a+|b){0,1}?'i AB y $&-$1 -
24b61696 406')('i - c - Unmatched )
1462b684
LW
407'[^ab]*'i CDE y $& CDE
408'abc'i n - -
409'a*'i y $&
410'([abc])*d'i ABBBCD y $&-$1 ABBBCD-C
411'([abc])*bcd'i ABCD y $&-$1 ABCD-A
412'a|b|c|d|e'i E y $& E
413'(a|b|c|d|e)f'i EF y $&-$1 EF-E
1462b684
LW
414'abcd*efg'i ABCDEFG y $& ABCDEFG
415'ab*'i XABYABBBZ y $& AB
416'ab*'i XAYABBBZ y $& A
417'(ab|cd)e'i ABCDE y $&-$1 CDE-CD
418'[abhgefdc]ij'i HIJ y $& HIJ
419'^(ab|cd)e'i ABCDE n x$1y XY
420'(abc|)ef'i ABCDEF y $&-$1 EF-
421'(a|b)c*d'i ABCD y $&-$1 BCD-B
422'(ab|ab*)bc'i ABC y $&-$1 ABC-A
423'a([bc]*)c*'i ABC y $&-$1 ABC-BC
424'a([bc]*)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
425'a([bc]+)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
426'a([bc]*)(c+d)'i ABCD y $&-$1-$2 ABCD-B-CD
427'a[bcd]*dcdcde'i ADCDCDE y $& ADCDCDE
428'a[bcd]+dcdcde'i ADCDCDE n - -
429'(ab|a)b*c'i ABC y $&-$1 ABC-AB
430'((a)(b)c)(d)'i ABCD y $1-$2-$3-$4 ABC-A-B-D
431'[a-zA-Z_][a-zA-Z0-9_]*'i ALPHA y $& ALPHA
432'^a(bc+|b[eh])g|.h$'i ABH y $&-$1 BH-
433'(bc+d$|ef*g.|h?i(j|k))'i EFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
434'(bc+d$|ef*g.|h?i(j|k))'i IJ y $&-$1-$2 IJ-IJ-J
435'(bc+d$|ef*g.|h?i(j|k))'i EFFG n - -
436'(bc+d$|ef*g.|h?i(j|k))'i BCDD n - -
437'(bc+d$|ef*g.|h?i(j|k))'i REFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
438'((((((((((a))))))))))'i A y $10 A
439'((((((((((a))))))))))\10'i AA y $& AA
9d116dd7
JH
440'((((((((((a))))))))))${bang}'i AA n - -
441'((((((((((a))))))))))${bang}'i A! y $& A!
1462b684 442'(((((((((a)))))))))'i A y $& A
a0d0e21e
LW
443'(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))'i A y $1 A
444'(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))'i C y $1 C
1462b684
LW
445'multiple words of text'i UH-UH n - -
446'multiple words'i MULTIPLE WORDS, YEAH y $& MULTIPLE WORDS
447'(.*)c(.*)'i ABCDE y $&-$1-$2 ABCDE-AB-DE
448'\((.*), (.*)\)'i (A, B) y ($2, $1) (B, A)
449'[k]'i AB n - -
b2a156bd
DM
450'abcd'i ABCD y $&-\$&-\\$& ABCD-\$&-\\ABCD
451'a(bc)d'i ABCD y $1-\$1-\\$1 BC-\$1-\\BC
1462b684
LW
452'a[-]?c'i AC y $& AC
453'(abc)\1'i ABCABC y $1 ABC
454'([a-c]*)\1'i ABCABC y $1 ABC
a0d0e21e 455a(?!b). abad y $& ad
89c6a13e 456(?=)a a y $& a
a0d0e21e
LW
457a(?=d). abad y $& ad
458a(?=c|d). abad y $& ad
459a(?:b|c|d)(.) ace y $1 e
460a(?:b|c|d)*(.) ace y $1 e
461a(?:b|c|d)+?(.) ace y $1 e
c277df42
IZ
462a(?:b|c|d)+?(.) acdbcdbe y $1 d
463a(?:b|c|d)+(.) acdbcdbe y $1 e
464a(?:b|c|d){2}(.) acdbcdbe y $1 b
465a(?:b|c|d){4,5}(.) acdbcdbe y $1 b
466a(?:b|c|d){4,5}?(.) acdbcdbe y $1 d
467((foo)|(bar))* foobar y $1-$2-$3 bar-foo-bar
9baa0206 468:(?: - c - Sequence (? incomplete
c277df42
IZ
469a(?:b|c|d){6,7}(.) acdbcdbe y $1 e
470a(?:b|c|d){6,7}?(.) acdbcdbe y $1 e
471a(?:b|c|d){5,6}(.) acdbcdbe y $1 e
472a(?:b|c|d){5,6}?(.) acdbcdbe y $1 b
473a(?:b|c|d){5,7}(.) acdbcdbe y $1 e
474a(?:b|c|d){5,7}?(.) acdbcdbe y $1 b
a0d0e21e
LW
475a(?:b|(c|e){1,2}?|d)+?(.) ace y $1$2 ce
476^(.+)?B AB y $1 A
c277df42
IZ
477^([^a-z])|(\^)$ . y $1 .
478^[<>]& <&OUT y $& <&
479^(a\1?){4}$ aaaaaaaaaa y $1 aaaa
480^(a\1?){4}$ aaaaaaaaa n - -
481^(a\1?){4}$ aaaaaaaaaaa n - -
af3f8c16
IZ
482^(a(?(1)\1)){4}$ aaaaaaaaaa y $1 aaaa
483^(a(?(1)\1)){4}$ aaaaaaaaa n - -
484^(a(?(1)\1)){4}$ aaaaaaaaaaa n - -
708e3b05
IZ
485((a{4})+) aaaaaaaaa y $1 aaaaaaaa
486(((aa){2})+) aaaaaaaaaa y $1 aaaaaaaa
487(((a{2}){2})+) aaaaaaaaaa y $1 aaaaaaaa
c277df42
IZ
488(?:(f)(o)(o)|(b)(a)(r))* foobar y $1:$2:$3:$4:$5:$6 f:o:o:b:a:r
489(?<=a)b ab y $& b
490(?<=a)b cb n - -
491(?<=a)b b n - -
492(?<!c)b ab y $& b
493(?<!c)b cb n - -
494(?<!c)b b y - -
495(?<!c)b b y $& b
1f4f6bf1 496(?<%)b - c - Group name must start with a non-digit word character
c277df42
IZ
497(?:..)*a aba y $& aba
498(?:..)*?a aba y $& a
499^(?:b|a(?=(.)))*\1 abc y $& ab
500^(){3,5} abc y a$1 a
501^(a+)*ax aax y $1 a
502^((a|b)+)*ax aax y $1 a
503^((a|bc)+)*ax aax y $1 a
504(a|x)*ab cab y y$1 y
505(a)*ab cab y y$1 y
506(?:(?i)a)b ab y $& ab
507((?i)a)b ab y $&:$1 ab:a
508(?:(?i)a)b Ab y $& Ab
509((?i)a)b Ab y $&:$1 Ab:A
510(?:(?i)a)b aB n - -
511((?i)a)b aB n - -
ca9dfc88
IZ
512(?i:a)b ab y $& ab
513((?i:a))b ab y $&:$1 ab:a
514(?i:a)b Ab y $& Ab
515((?i:a))b Ab y $&:$1 Ab:A
516(?i:a)b aB n - -
517((?i:a))b aB n - -
518'(?:(?-i)a)b'i ab y $& ab
519'((?-i)a)b'i ab y $&:$1 ab:a
520'(?:(?-i)a)b'i aB y $& aB
521'((?-i)a)b'i aB y $&:$1 aB:a
522'(?:(?-i)a)b'i Ab n - -
523'((?-i)a)b'i Ab n - -
524'(?:(?-i)a)b'i aB y $& aB
525'((?-i)a)b'i aB y $1 a
526'(?:(?-i)a)b'i AB n - -
527'((?-i)a)b'i AB n - -
528'(?-i:a)b'i ab y $& ab
529'((?-i:a))b'i ab y $&:$1 ab:a
530'(?-i:a)b'i aB y $& aB
531'((?-i:a))b'i aB y $&:$1 aB:a
532'(?-i:a)b'i Ab n - -
533'((?-i:a))b'i Ab n - -
534'(?-i:a)b'i aB y $& aB
535'((?-i:a))b'i aB y $1 a
536'(?-i:a)b'i AB n - -
537'((?-i:a))b'i AB n - -
538'((?-i:a.))b'i a\nB n - -
afefe6bf 539'((?-i:a\N))b'i a\nB n - -
ca9dfc88 540'((?s-i:a.))b'i a\nB y $1 a\n
afefe6bf 541'((?s-i:a\N))b'i a\nB n - -
ca9dfc88 542'((?s-i:a.))b'i B\nB n - -
afefe6bf 543'((?s-i:a\N))b'i B\nB n - -
c277df42
IZ
544(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b))) cabbbb y $& cabbbb
545(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb))) caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb y $& caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
546'(ab)\d\1'i Ab4ab y $1 Ab
547'(ab)\d\1'i ab4Ab y $1 ab
ad4f75a6 548foo\w*\d{4}baz foobar1234baz y $& foobar1234baz
61525e55 549a(?{})b cabd y $& ab
9da1dd8f
DM
550a(?{f()+ - c - Missing right curly or square bracket
551a(?{{1}+ - c - Missing right curly or square bracket
f8a7cceb 552 (?{(^{}) - c - syntax error
380a0633 553a(?{}})b - c -
b30fcab9 554a(?{"{"})b ab y - -
61525e55 555a(?{"\{"})b cabd y $& ab
9da1dd8f 556a(?{"{"}})b - c - Sequence (?{...}) not terminated with ')'
94c1d7aa 557a(?{$::bl="\{"}).b caxbd y $::bl {
c277df42
IZ
558x(~~)*(?:(?:F)?)? x~~ y - -
559^a(?#xxx){3}c aaac y $& aaac
560'^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
561(?<![cd])b dbcb n - -
562(?<![cd])[ab] dbaacb y $& a
563(?<!(c|d))b dbcb n - -
564(?<!(c|d))[ab] dbaacb y $& a
565(?<!cd)[ab] cdaccb y $& b
566^(?:a?b?)*$ a-- n - -
567((?s)^a(.))((?m)^b$) a\nb\nc\n y $1;$2;$3 a\n;\n;b
568((?m)^b$) a\nb\nc\n y $1 b
569(?m)^b a\nb\n y $& b
570(?m)^(b) a\nb\n y $1 b
571((?m)^b) a\nb\n y $1 b
572\n((?m)^b) a\nb\n y $1 b
573((?s).)c(?!.) a\nb\nc\n y $1 \n
574((?s).)c(?!.) a\nb\nc\n y $1:$& \n:\nc
575((?s)b.)c(?!.) a\nb\nc\n y $1 b\n
576((?s)b.)c(?!.) a\nb\nc\n y $1:$& b\n:b\nc
cbf4a129
RGS
577((?s)b.)c(?!\N) a\nb\nc\n y $1:$& b\n:b\nc
578'(b.)c(?!\N)'s a\nb\nc\n y $1:$& b\n:b\nc
c277df42
IZ
579^b a\nb\nc\n n - -
580()^b a\nb\nc\n n - -
581((?m)^b) a\nb\nc\n y $1 b
582(?(1)a|b) a n - -
583(?(1)b|a) a y $& a
584(x)?(?(1)a|b) a n - -
585(x)?(?(1)b|a) a y $& a
586()?(?(1)b|a) a y $& a
587()(?(1)b|a) a n - -
588()?(?(1)a|b) a y $& a
589^(\()?blah(?(1)(\)))$ (blah) y $2 )
590^(\()?blah(?(1)(\)))$ blah y ($2) ()
591^(\()?blah(?(1)(\)))$ blah) n - -
592^(\()?blah(?(1)(\)))$ (blah n - -
593^(\(+)?blah(?(1)(\)))$ (blah) y $2 )
594^(\(+)?blah(?(1)(\)))$ blah y ($2) ()
595^(\(+)?blah(?(1)(\)))$ blah) n - -
596^(\(+)?blah(?(1)(\)))$ (blah n - -
0f7276ab
KW
597(?(1?)a|b) - c - Switch condition not recognized
598(?(1)a|b|c) - c - Switch (?(condition)... contains too many branches
61525e55
NC
599(?(?{0})a|b) a n - -
600(?(?{0})b|a) a y $& a
601(?(?{1})b|a) a n - -
602(?(?{1})a|b) a y $& a
c277df42
IZ
603(?(?!a)a|b) a n - -
604(?(?!a)b|a) a y $& a
605(?(?=a)b|a) a n - -
606(?(?=a)a|b) a y $& a
e22f9b1c
NC
607(?(?!\x{100})\x{100}|b) \x{100} n - -
608(?(?!\x{100})b|\x{100}) \x{100} y $& \x{100}
609(?(?=\x{100})b|\x{100}) \x{100} n - -
610(?(?=\x{100})\x{100}|b) \x{100} y $& \x{100}
c277df42
IZ
611(?=(a+?))(\1ab) aaab y $2 aab
612^(?=(a+?))\1ab aaab n - -
613(\w+:)+ one: y $1 one:
614$(?<=^(a)) a y $1 a
615(?=(a+?))(\1ab) aaab y $2 aab
616^(?=(a+?))\1ab aaab n - -
617([\w:]+::)?(\w+)$ abcd: n - -
618([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
619([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
620^[^bcd]*(c+) aexycd y $1 c
621(a*)b+ caab y $1 aa
622([\w:]+::)?(\w+)$ abcd: n - -
623([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
624([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
625^[^bcd]*(c+) aexycd y $1 c
94c1d7aa
DM
626(?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a}) yaaxxaaaacd y $b 3
627(?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a}) yaaxxaaaacd y $b 4
f5df269c
FC
628# [perl #117917]
629^(a(?{ "x" =~ m{x}})b)(??{ $1 }) abab y $& abab
c277df42 630(>a+)ab aaab n - -
fe44a5e8 631(?>a+)b aaab y - -
4599a1de
JH
632([[:]+) a:[b]: y $1 :[
633([[=]+) a=[b]= y $1 =[
634([[.]+) a.[b]. y $1 .[
24b61696
RK
635[a[:xyz: - c - Unmatched [
636[a[:xyz:] - c - POSIX class [:xyz:] unknown
767d463e 637[a[:]b[:c] abc y $& abc
0f7276ab 638([a[:xyz:]b]+) - c - POSIX class [:xyz:] unknown
b8c5462f
JH
639([[:alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
640([[:alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
641([[:ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__-- ${nulnul}
b41acb1e 642([[:cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} ya $1 ${nulnul} ff is a control on EBCDIC (non-POSIX-BC), so this fails under /u rules
b8c5462f
JH
643([[:digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
644([[:graph:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
645([[:lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd
646([[:print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
647([[:punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __--
648([[:space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1
649([[:word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__
650([[:upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
651([[:xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01
652([[:^alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
cfaf538b 653((?a)[[:^alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __-- ${nulnul}${ffff}
b8c5462f 654([[:^ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${ffff}
2a79fb66 655([:[:^ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${ffff} RT #120799
b8c5462f
JH
656([[:^cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
657([[:^digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
658([[:^lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
cfaf538b 659((?a)[[:^print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}${ffff}
b8c5462f
JH
660([[:^punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
661([[:^space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
cfaf538b 662((?a)[[:^word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 -- ${nulnul}${ffff}
b8c5462f
JH
663([[:^upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd01
664([[:^xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 Xy__-- ${nulnul}${ffff}
24b61696
RK
665[[:foo:]] - c - POSIX class [:foo:] unknown
666[[:^foo:]] - c - POSIX class [:^foo:] unknown
837226c8 667'[[:^cntrl:]]+'u a\x80 y $& a \x80 was matching on EBCDIC platforms
fe44a5e8
IZ
668((?>a+)b) aaab y $1 aaab
669(?>(a+))b aaab y $1 aaa
c277df42 670((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
24b61696 671(?<=x+)y - c - Variable length lookbehind not implemented
31c15ce5 672((def){37,17})?ABC ABC y $& ABC
cf93c79d
IZ
673\Z a\nb\n y $-[0] 3
674\z a\nb\n y $-[0] 4
675$ a\nb\n y $-[0] 3
676\Z b\na\n y $-[0] 3
677\z b\na\n y $-[0] 4
678$ b\na\n y $-[0] 3
679\Z b\na y $-[0] 3
680\z b\na y $-[0] 3
681$ b\na y $-[0] 3
682'\Z'm a\nb\n y $-[0] 3
683'\z'm a\nb\n y $-[0] 4
684'$'m a\nb\n y $-[0] 1
685'\Z'm b\na\n y $-[0] 3
686'\z'm b\na\n y $-[0] 4
687'$'m b\na\n y $-[0] 1
688'\Z'm b\na y $-[0] 3
689'\z'm b\na y $-[0] 3
690'$'m b\na y $-[0] 1
b85d18e9 691a\Z a\nb\n n - -
cf93c79d
IZ
692a\z a\nb\n n - -
693a$ a\nb\n n - -
694a\Z b\na\n y $-[0] 2
695a\z b\na\n n - -
696a$ b\na\n y $-[0] 2
697a\Z b\na y $-[0] 2
698a\z b\na y $-[0] 2
699a$ b\na y $-[0] 2
a1917ab9 700'a\Z'm a\nb\n n - -
cf93c79d
IZ
701'a\z'm a\nb\n n - -
702'a$'m a\nb\n y $-[0] 0
703'a\Z'm b\na\n y $-[0] 2
704'a\z'm b\na\n n - -
705'a$'m b\na\n y $-[0] 2
706'a\Z'm b\na y $-[0] 2
707'a\z'm b\na y $-[0] 2
708'a$'m b\na y $-[0] 2
709aa\Z aa\nb\n n - -
710aa\z aa\nb\n n - -
711aa$ aa\nb\n n - -
712aa\Z b\naa\n y $-[0] 2
713aa\z b\naa\n n - -
714aa$ b\naa\n y $-[0] 2
715aa\Z b\naa y $-[0] 2
716aa\z b\naa y $-[0] 2
717aa$ b\naa y $-[0] 2
a1917ab9 718'aa\Z'm aa\nb\n n - -
cf93c79d
IZ
719'aa\z'm aa\nb\n n - -
720'aa$'m aa\nb\n y $-[0] 0
721'aa\Z'm b\naa\n y $-[0] 2
722'aa\z'm b\naa\n n - -
723'aa$'m b\naa\n y $-[0] 2
724'aa\Z'm b\naa y $-[0] 2
725'aa\z'm b\naa y $-[0] 2
726'aa$'m b\naa y $-[0] 2
727aa\Z ac\nb\n n - -
728aa\z ac\nb\n n - -
729aa$ ac\nb\n n - -
730aa\Z b\nac\n n - -
731aa\z b\nac\n n - -
732aa$ b\nac\n n - -
733aa\Z b\nac n - -
734aa\z b\nac n - -
735aa$ b\nac n - -
736'aa\Z'm ac\nb\n n - -
737'aa\z'm ac\nb\n n - -
738'aa$'m ac\nb\n n - -
739'aa\Z'm b\nac\n n - -
740'aa\z'm b\nac\n n - -
741'aa$'m b\nac\n n - -
742'aa\Z'm b\nac n - -
743'aa\z'm b\nac n - -
744'aa$'m b\nac n - -
745aa\Z ca\nb\n n - -
746aa\z ca\nb\n n - -
747aa$ ca\nb\n n - -
748aa\Z b\nca\n n - -
749aa\z b\nca\n n - -
750aa$ b\nca\n n - -
751aa\Z b\nca n - -
752aa\z b\nca n - -
753aa$ b\nca n - -
754'aa\Z'm ca\nb\n n - -
755'aa\z'm ca\nb\n n - -
756'aa$'m ca\nb\n n - -
757'aa\Z'm b\nca\n n - -
758'aa\z'm b\nca\n n - -
759'aa$'m b\nca\n n - -
760'aa\Z'm b\nca n - -
761'aa\z'm b\nca n - -
762'aa$'m b\nca n - -
763ab\Z ab\nb\n n - -
764ab\z ab\nb\n n - -
765ab$ ab\nb\n n - -
766ab\Z b\nab\n y $-[0] 2
767ab\z b\nab\n n - -
768ab$ b\nab\n y $-[0] 2
769ab\Z b\nab y $-[0] 2
770ab\z b\nab y $-[0] 2
771ab$ b\nab y $-[0] 2
a1917ab9 772'ab\Z'm ab\nb\n n - -
cf93c79d
IZ
773'ab\z'm ab\nb\n n - -
774'ab$'m ab\nb\n y $-[0] 0
775'ab\Z'm b\nab\n y $-[0] 2
776'ab\z'm b\nab\n n - -
777'ab$'m b\nab\n y $-[0] 2
778'ab\Z'm b\nab y $-[0] 2
779'ab\z'm b\nab y $-[0] 2
780'ab$'m b\nab y $-[0] 2
781ab\Z ac\nb\n n - -
782ab\z ac\nb\n n - -
783ab$ ac\nb\n n - -
784ab\Z b\nac\n n - -
785ab\z b\nac\n n - -
786ab$ b\nac\n n - -
787ab\Z b\nac n - -
788ab\z b\nac n - -
789ab$ b\nac n - -
790'ab\Z'm ac\nb\n n - -
791'ab\z'm ac\nb\n n - -
792'ab$'m ac\nb\n n - -
793'ab\Z'm b\nac\n n - -
794'ab\z'm b\nac\n n - -
795'ab$'m b\nac\n n - -
796'ab\Z'm b\nac n - -
797'ab\z'm b\nac n - -
798'ab$'m b\nac n - -
799ab\Z ca\nb\n n - -
800ab\z ca\nb\n n - -
801ab$ ca\nb\n n - -
802ab\Z b\nca\n n - -
803ab\z b\nca\n n - -
804ab$ b\nca\n n - -
805ab\Z b\nca n - -
806ab\z b\nca n - -
807ab$ b\nca n - -
808'ab\Z'm ca\nb\n n - -
809'ab\z'm ca\nb\n n - -
810'ab$'m ca\nb\n n - -
811'ab\Z'm b\nca\n n - -
812'ab\z'm b\nca\n n - -
813'ab$'m b\nca\n n - -
814'ab\Z'm b\nca n - -
815'ab\z'm b\nca n - -
816'ab$'m b\nca n - -
817abb\Z abb\nb\n n - -
818abb\z abb\nb\n n - -
819abb$ abb\nb\n n - -
820abb\Z b\nabb\n y $-[0] 2
821abb\z b\nabb\n n - -
822abb$ b\nabb\n y $-[0] 2
823abb\Z b\nabb y $-[0] 2
824abb\z b\nabb y $-[0] 2
825abb$ b\nabb y $-[0] 2
a1917ab9 826'abb\Z'm abb\nb\n n - -
cf93c79d
IZ
827'abb\z'm abb\nb\n n - -
828'abb$'m abb\nb\n y $-[0] 0
829'abb\Z'm b\nabb\n y $-[0] 2
830'abb\z'm b\nabb\n n - -
831'abb$'m b\nabb\n y $-[0] 2
832'abb\Z'm b\nabb y $-[0] 2
833'abb\z'm b\nabb y $-[0] 2
834'abb$'m b\nabb y $-[0] 2
835abb\Z ac\nb\n n - -
836abb\z ac\nb\n n - -
837abb$ ac\nb\n n - -
838abb\Z b\nac\n n - -
839abb\z b\nac\n n - -
840abb$ b\nac\n n - -
841abb\Z b\nac n - -
842abb\z b\nac n - -
843abb$ b\nac n - -
844'abb\Z'm ac\nb\n n - -
845'abb\z'm ac\nb\n n - -
846'abb$'m ac\nb\n n - -
847'abb\Z'm b\nac\n n - -
848'abb\z'm b\nac\n n - -
849'abb$'m b\nac\n n - -
850'abb\Z'm b\nac n - -
851'abb\z'm b\nac n - -
852'abb$'m b\nac n - -
853abb\Z ca\nb\n n - -
854abb\z ca\nb\n n - -
855abb$ ca\nb\n n - -
856abb\Z b\nca\n n - -
857abb\z b\nca\n n - -
858abb$ b\nca\n n - -
859abb\Z b\nca n - -
860abb\z b\nca n - -
861abb$ b\nca n - -
862'abb\Z'm ca\nb\n n - -
863'abb\z'm ca\nb\n n - -
864'abb$'m ca\nb\n n - -
865'abb\Z'm b\nca\n n - -
866'abb\z'm b\nca\n n - -
867'abb$'m b\nca\n n - -
868'abb\Z'm b\nca n - -
869'abb\z'm b\nca n - -
870'abb$'m b\nca n - -
fad493ef 871'\Aa$'m a\n\n y $& a
8e680dc3 872(^|x)(c) ca y $2 c
aca2d497 873a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz x n - -
94c1d7aa 874a(?{$a=2;$b=3;($b)=$a})b yabz y $b 2
9fe1d20c 875round\(((?>[^()]+))\) _I(round(xs * sz),1) y $1 xs * sz
ce3e6498
HS
876'((?x:.) )' x y $1- x -
877'((?-x:.) )'x x y $1- x-
adac82c7 878foo.bart foo.bart y - -
2c2d71f5
JH
879'^d[x][x][x]'m abcd\ndxxx y - -
880.X(.+)+X bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
881.X(.+)+XX bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
882.XX(.+)+X bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
883.X(.+)+X bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
884.X(.+)+XX bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
885.XX(.+)+X bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
886.X(.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
887.X(.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
888.XX(.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
889.X(.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
890.X(.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
891.XX(.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
892.[X](.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
893.[X](.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
894.[X][X](.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
895.[X](.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
896.[X](.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
897.[X][X](.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
898tt+$ xxxtt y - -
073b366a
KW
899([a-\d]+) za-9z Sy $1 a-9
900([a-\d]+) - sc - False [] range
901([\d-z]+) a0-za Sy $1 0-z
902([\d-z]+) - sc $1 False [] range
903([\d-\s]+) a0- z Sy $1 0-
904([\d-\s]+) - sc $1 False [] range
905([a-[:digit:]]+) za-9z Sy $1 a-9
906([a-[:digit:]]+) - sc - False [] range
907([[:digit:]-z]+) =0-z= Sy $1 0-z
908([[:digit:]-z]+) - sc c False [] range
909([[:digit:]-[:alpha:]]+) =0-z= Sy $1 0-z
910([[:digit:]-[:alpha:]]+) - sc - False [] range
30382c73 911\GX.*X aaaXbX n - -
6eb5f6b9
JH
912(\d+\.\d+) 3.1415926 y $1 3.1415926
913(\ba.{0,10}br) have a web browser y $1 a web br
66e933ab
GS
914'\.c(pp|xx|c)?$'i Changes n - -
915'\.c(pp|xx|c)?$'i IO.c y - -
916'(\.c(pp|xx|c)?$)'i IO.c y $1 .c
653099ff 917^([a-z]:) C:/ n - -
60e71179 918'^\S\s+aa$'m \nx aa y - -
de0c8cb8 919(^|a)b ab y - -
f06a1d4e 920^([ab]*?)(b)?(c)$ abac y -$2- --
29d1e993 921(\w)?(abc)\1b abcab n - -
2a8d9689
HS
922^(?:.,){2}c a,b,c y - -
923^(.,){2}c a,b,c y $1 b,
924^(?:[^,]*,){2}c a,b,c y - -
925^([^,]*,){2}c a,b,c y $1 b,
4b2cff9a
HS
926^([^,]*,){3}d aaa,b,c,d y $1 c,
927^([^,]*,){3,}d aaa,b,c,d y $1 c,
928^([^,]*,){0,3}d aaa,b,c,d y $1 c,
929^([^,]{1,3},){3}d aaa,b,c,d y $1 c,
930^([^,]{1,3},){3,}d aaa,b,c,d y $1 c,
931^([^,]{1,3},){0,3}d aaa,b,c,d y $1 c,
932^([^,]{1,},){3}d aaa,b,c,d y $1 c,
933^([^,]{1,},){3,}d aaa,b,c,d y $1 c,
934^([^,]{1,},){0,3}d aaa,b,c,d y $1 c,
935^([^,]{0,3},){3}d aaa,b,c,d y $1 c,
936^([^,]{0,3},){3,}d aaa,b,c,d y $1 c,
937^([^,]{0,3},){0,3}d aaa,b,c,d y $1 c,
bf93d4cc 938(?i) y - -
cfaf538b 939(?a:((?u)\w)\W) \xC0\xC0 y $& \xC0\xC0
c2a73568 940'(?!\A)x'm a\nxb\n y - -
c1d44abf
JH
941^(a(b)?)+$ aba y -$1-$2- -a--
942^(aa(bb)?)+$ aabbaa y -$1-$2- -aa--
0e41cd87 943'^.{9}abc.*\n'm 123\nabcabcabcabc\n y - -
66417f84
HS
944^(a)?a$ a y -$1- --
945^(a)?(?(1)a|b)+$ a n - -
cb434fcc
IZ
946^(a\1?)(a\1?)(a\2?)(a\3?)$ aaaaaa y $1,$2,$3,$4 a,aa,a,aa
947^(a\1?){4}$ aaaaaa y $1 aa
948^(0+)?(?:x(1))? x1 y - -
949^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))? 012cxx0190 y - -
e1901655
IZ
950^(b+?|a){1,2}c bbbac y $1 a
951^(b+?|a){1,2}c bbbbac y $1 a
2e36c929 952\((\w\. \w+)\) cd. (A. Tw) y -$1- -A. Tw-
f49d4d0f
HS
953((?:aaaa|bbbb)cccc)? aaaacccc y - -
954((?:aaaa|bbbb)cccc)? bbbbcccc y - -
36670241
JH
955(a)?(a)+ a y $1:$2 :a -
956(ab)?(ab)+ ab y $1:$2 :ab -
957(abc)?(abc)+ abc y $1:$2 :abc -
12d33761 958'b\s^'m a\nb\n n - -
ee0b7718 959\ba a y - -
ee95e30c
FC
960^(a(??{"(?!)"})|(a)(?{1}))b ab y $2 a # [ID 20010811.006 (#7512)]
961ab(?i)cd AbCd n - - # [ID 20010809.023 (#7503)]
055bb491 962ab(?i)cd abCd y - -
f31a99c8
HS
963(A|B)*(?(1)(CD)|(CD)) CD y $2-$3 -CD
964(A|B)*(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
ee95e30c 965(A|B)*?(?(1)(CD)|(CD)) CD y $2-$3 -CD # [ID 20010803.016 (#7438)]
f31a99c8 966(A|B)*?(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
f65d3ee7 967'^(o)(?!.*\1)'i Oo n - -
24ba5a3c 968(.*)\d+\1 abc12bc y $1 bc
1ac24cf0 969(?m:(foo\s*$)) foo\n bar y $1 foo
a84d97b6
HS
970(.*)c abcd y $1 ab
971(.*)(?=c) abcd y $1 ab
972(.*)(?=c)c abcd yB $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 yB $1 ab
979(.*)(?<=b) abcd y $1 ab
980(.*)(?<=b)c abcd y $1 ab
981(.*)(?<=b|c) abcd y $1 abc
982(.*)(?<=b|c)c abcd y $1 ab
983(.*)(?<=c|b) abcd y $1 abc
984(.*)(?<=c|b)c abcd y $1 ab
985(.*)(?<=[bc]) abcd y $1 abc
986(.*)(?<=[bc])c abcd y $1 ab
987(.*?)c abcd y $1 ab
988(.*?)(?=c) abcd y $1 ab
989(.*?)(?=c)c abcd yB $1 ab
990(.*?)(?=b|c) abcd y $1 a
991(.*?)(?=b|c)c abcd y $1 ab
992(.*?)(?=c|b) abcd y $1 a
993(.*?)(?=c|b)c abcd y $1 ab
994(.*?)(?=[bc]) abcd y $1 a
995(.*?)(?=[bc])c abcd yB $1 ab
996(.*?)(?<=b) abcd y $1 ab
997(.*?)(?<=b)c abcd y $1 ab
998(.*?)(?<=b|c) abcd y $1 ab
999(.*?)(?<=b|c)c abcd y $1 ab
1000(.*?)(?<=c|b) abcd y $1 ab
1001(.*?)(?<=c|b)c abcd y $1 ab
1002(.*?)(?<=[bc]) abcd y $1 ab
1003(.*?)(?<=[bc])c abcd y $1 ab
d3aea5f7 10042(]*)?$\1 2 y $& 2
61525e55 1005(??{}) x y - -
ecc99935 1006a(b)?? abc y <$1> <> # undef [perl #16773]
c152dc43 1007(\d{1,3}\.){3,} 128.134.142.8 y <$1> <142.> # [perl #18019]
b0e70d55
HS
1008^.{3,4}(.+)\1\z foobarbar y $1 bar # 16 tests for [perl #23171]
1009^(?:f|o|b){3,4}(.+)\1\z foobarbar y $1 bar
1010^.{3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
1011^(?:f|o|b){3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
1012^.{3,4}(.+?)\1\z foobarbar y $1 bar
1013^(?:f|o|b){3,4}(.+?)\1\z foobarbar y $1 bar
1014^.{3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
1015^(?:f|o|b){3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
1016^.{2,3}?(.+)\1\z foobarbar y $1 bar
1017^(?:f|o|b){2,3}?(.+)\1\z foobarbar y $1 bar
1018^.{2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
1019^(?:f|o|b){2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
1020^.{2,3}?(.+?)\1\z foobarbar y $1 bar
1021^(?:f|o|b){2,3}?(.+?)\1\z foobarbar y $1 bar
1022^.{2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
1023^(?:f|o|b){2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
c2b0868c 1024.*a(?!(b|cd)*e).*f ......abef n - - # [perl #23030]
0f7276ab
KW
1025x(?# - c - Sequence (?#... not terminated
1026:x(?#: - c - Sequence (?#... not terminated
a3621e74
YO
1027(WORDS|WORD)S WORDS y $1 WORD
1028(X.|WORDS|X.|WORD)S WORDS y $1 WORD
1029(WORDS|WORLD|WORD)S WORDS y $1 WORD
1030(X.|WORDS|WORD|Y.)S WORDS y $1 WORD
1031(foo|fool|x.|money|parted)$ fool y $1 fool
1032(x.|foo|fool|x.|money|parted|y.)$ fool y $1 fool
1033(foo|fool|money|parted)$ fool y $1 fool
1034(foo|fool|x.|money|parted)$ fools n - -
1035(x.|foo|fool|x.|money|parted|y.)$ fools n - -
1036(foo|fool|money|parted)$ fools n - -
3dab1dad 1037(a|aa|aaa||aaaa|aaaaa|aaaaaa)(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
61525e55
NC
1038(a|aa|aaa||aaaa|aaaaa|aaaaaa)(??{$1&&""})(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
1039(a|aa|aaa|aaaa|aaaaa|aaaaaa)(??{$1&&"foo"})(b|c) aaaaaaaaaaaaaaab n - -
3ab3c9b4
HS
1040^(a*?)(?!(aa|aaaa)*$) aaaaaaaaaaaaaaaaaaaa y $1 a # [perl #34195]
1041^(a*?)(?!(aa|aaaa)*$)(?=a\z) aaaaaaaa y $1 aaaaaaa
c315bfe8 1042^(.)\s+.$(?(1)) A B y $1 A # [perl #37688]
3a2830be
A
1043(?:r?)*?r|(.{2,4}) abcde y $1 abcd
1044(?!)+?|(.{2,4}) abcde y $1 abcd
7409bbd3 1045^(a*?)(?!(a{6}|a{5})*$) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y $+[1] 12 # super-linear cache bug may return 18
dad79028
DM
1046^((?>(?:aa)?b)?) aab y $1 aab
1047^((?:aa)*)(?:X+((?:\d+|-)(?:X+(.+))?))?$ aaaaX5 y $1 aaaa
3dab1dad
YO
1048X(A|B||C|D)Y XXXYYY y $& XY # Trie w/ NOTHING
1049(?i:X([A]|[B]|y[Y]y|[D]|)Y) XXXYYYB y $& XY # Trie w/ NOTHING
40a82448 1050^([a]{1})*$ aa y $1 a
3298f257
DM
1051a(?!b(?!c))(..) abababc y $1 bc # test nested negatives
1052a(?!b(?=a))(..) abababc y $1 bc # test nested lookaheads
1053a(?!b(?!c(?!d(?!e))))...(.) abxabcdxabcde y $1 e
1054X(?!b+(?!(c+)*(?!(c+)*d))).*X aXbbbbbbbcccccccccccccaaaX y - -
786e8c11
YO
1055^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1056^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1057^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1058^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1059^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1060^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1061^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1062^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1063^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1064^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
1065^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
1066^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
1067X(?:ABCF[cC]x*|ABCD|ABCF):(?:DIT|DID|DIM) XABCFCxxxxxxxxxx:DIM y $& XABCFCxxxxxxxxxx:DIM
1068(((ABCD|ABCE|ABCF)))(A|B|C[xy]*): ABCFCxxxxxxxxxx:DIM y $& ABCFCxxxxxxxxxx:
1de06328
YO
1069(?=foo) foo y pos 0
1070(?=foo) XfooY y pos 1
1071.*(?=foo) XfooY y pos 1
06ab3c15 1072(?=.*P)P aP y pos 2
1de06328
YO
1073(?<=foo) foo y pos 3
1074(?<=foo) XfooY y pos 4
1075.*(?<=foo) foo y pos 3
1076.*(?<=foo) XfooY y pos 4
1077(?<=foo)Y XfooY y pos 5
1078o(?<=foo)Y ..XfooY.. y pos 7
1079X(?=foo)f ..XfooY.. y pos 4
1080X(?=foo) ..XfooY.. y pos 3
1081X(?<=foo.)[YZ] ..XfooXY.. y pos 8
1082(?=XY*foo) Xfoo y pos 0
1083^(?=XY*foo) Xfoo y pos 0
61525e55
NC
1084^(??{"a+"})a aa y $& aa
1085^(?:(??{"a+"})|b)a aa y $& aa
1086^(??{chr 0x100}).$ \x{100}\x{100} y $& \x{100}\x{100}
1087^(??{q(\x{100})}). \x{100}\x{100} y $& \x{100}\x{100}
1088^(??{q(.+)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1089^(??{q(.)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1090^(??{chr 0x100})\xbb \x{100}\x{bb} y $& \x{100}\x{bb}
1091^(.)(??{"(.)(.)"})(.)$ abcd y $1-$2 a-d
1092^(.)(??{"(bz+|.)(.)"})(.)$ abcd y $1-$2 a-d
1093^(.)((??{"(.)(cz+)"})|.) abcd y $1-$2 a-b
1094^a(?>(??{q(b)}))(??{q(c)})d abcd y - -
1095^x(??{""})+$ x y $& x
6bda09f9
YO
1096^(<(?:[^<>]+|(?3)|(?1))*>)()(!>!>!>)$ <<!>!>!>><>>!>!>!> y $1 <<!>!>!>><>>
1097^(<(?:[^<>]+|(?1))*>)$ <<><<<><>>>> y $1 <<><<<><>>>>
1098((?2)*)([fF]o+) fooFoFoo y $1-$2 fooFo-Foo
1099(<(?:[^<>]+|(?R))*>) <<><<<><>>>> y $1 <<><<<><>>>>
81714fb9 1100(?<n>foo|bar|baz) snofooewa y $1 foo
cb6fa888
NC
1101(?<n>foo|bar|baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1102(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1103(?<n>foo|bar|baz)(?<m>[ew]+) snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1104(?<n>foo)|(?<n>bar)|(?<n>baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1105(?<n>foo)(??{ $+{n} }) snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe 1106(?P<n>foo|bar|baz) snofooewa y $1 foo
cb6fa888
NC
1107(?P<n>foo|bar|baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1108(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1109(?P<n>foo|bar|baz)(?P<m>[ew]+) snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1110(?P<n>foo)|(?P<n>bar)|(?P<n>baz) snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1111(?P<n>foo)(??{ $+{n} }) snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
0f7276ab
KW
1112(?P<=n>foo|bar|baz) - c - Group name must start with a non-digit word character
1113(?P<!n>foo|bar|baz) - c - Group name must start with a non-digit word character
8a6d8ec6 1114(?PX<n>foo|bar|baz) - c - Sequence (?PX...) not recognized
81714fb9 1115/(?'n'foo|bar|baz)/ snofooewa y $1 foo
cb6fa888
NC
1116/(?'n'foo|bar|baz)/ snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1117/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1118/(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa yM $+{m} ew miniperl cannot load Tie::Hash::NamedCapture
1119/(?'n'foo)|(?'n'bar)|(?<n>baz)/ snobazewa yM $+{n} baz miniperl cannot load Tie::Hash::NamedCapture
1120/(?'n'foo)(??{ $+{n} })/ snofooefoofoowaa yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
81714fb9 1121/(?'n'foo)\k<n>/ ..foofoo.. y $1 foo
cb6fa888 1122/(?'n'foo)\k<n>/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
81714fb9 1123/(?<n>foo)\k'n'/ ..foofoo.. y $1 foo
cb6fa888
NC
1124/(?<n>foo)\k'n'/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1125/(?:(?<n>foo)|(?<n>bar))\k<n>/ ..barbar.. yM $+{n} bar miniperl cannot load Tie::Hash::NamedCapture
1126/^(?'main'<(?:[^<>]+|(?&crap)|(?&main))*>)(?'empty')(?'crap'!>!>!>)$/ <<!>!>!>><>>!>!>!> yM $+{main} <<!>!>!>><>> miniperl cannot load Tie::Hash::NamedCapture
894be9b7 1127/^(?'main'<(?:[^<>]+|(?&main))*>)$/ <<><<<><>>>> y $1 <<><<<><>>>>
cb6fa888
NC
1128/(?'first'(?&second)*)(?'second'[fF]o+)/ fooFoFoo yM $+{first}-$+{second} fooFo-Foo miniperl cannot load Tie::Hash::NamedCapture
1129(?<A>foo)?(?(<A>)bar|nada) foobar yM $+{A} foo miniperl cannot load Tie::Hash::NamedCapture
0a4db386
YO
1130(?<A>foo)?(?(<A>)bar|nada) foo-barnada y $& nada
1131(?<A>foo)?(?(1)bar|nada) foo-barnada y $& nada
1132(?<A>foo(?(R)bar))?(?1) foofoobar y $1 foo
1133(?<A>foo(?(R)bar))?(?1) foofoobar y $& foofoobar
1134(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $2 foo
1135(x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $& xfoofoobar
1136(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $2 foo
1137(x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $& xfoofoobar
1138(?1)(?(DEFINE)(blah)) blah y $& blah
1139/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamimadam y $& madamimadam
1140/^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamiamadam n - -
1141/(a)?((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1142/(a)*((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1143/(a)+((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1144/(a){1,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1145/(a){0,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1146/(ab)?((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1147/(ab)*((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1148/(ab)+((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1149/(ab){1,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1150/(ab){0,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
efcc8bfd
FC
1151foo(?0)?bar phoofoofoobarbarbarr y $& foofoobarbar
1152foo(?R)?bar phoofoofoobarbarbarr y $& foofoobarbar
b9b4dddf
YO
1153# possessive captures
1154a++a aaaaa n - -
1155a*+a aaaaa n - -
1156a{1,5}+a aaaaa n - -
1157a?+a ab n - -
1158a++b aaaaab y $& aaaaab
1159a*+b aaaaab y $& aaaaab
1160a{1,5}+b aaaaab y $& aaaaab
1161a?+b ab y $& ab
1162fooa++a fooaaaaa n - -
1163fooa*+a fooaaaaa n - -
1164fooa{1,5}+a fooaaaaa n - -
1165fooa?+a fooab n - -
1166fooa++b fooaaaaab y $& fooaaaaab
1167fooa*+b fooaaaaab y $& fooaaaaab
1168fooa{1,5}+b fooaaaaab y $& fooaaaaab
1169fooa?+b fooab y $& fooab
1170(?:aA)++(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1171(aA)++(aA) aAaAaAaAaA n - aAaAaAaAaA
1172(aA|bB)++(aA|bB) aAaAbBaAbB n - aAaAbBaAbB
1173(?:aA|bB)++(?:aA|bB) aAbBbBbBaA n - aAbBbBbBaA
1174(?:aA)*+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1175(aA)*+(aA) aAaAaAaAaA n - aAaAaAaAaA
1176(aA|bB)*+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1177(?:aA|bB)*+(?:aA|bB) aAaAaAbBaA n - aAaAaAbBaA
1178(?:aA){1,5}+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1179(aA){1,5}+(aA) aAaAaAaAaA n - aAaAaAaAaA
1180(aA|bB){1,5}+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1181(?:aA|bB){1,5}+(?:aA|bB) bBbBbBbBbB n - bBbBbBbBbB
1182(?:aA)?+(?:aA) aAb n - aAb
1183(aA)?+(aA) aAb n - aAb
1184(aA|bB)?+(aA|bB) bBb n - bBb
1185(?:aA|bB)?+(?:aA|bB) aAb n - aAb
1186(?:aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1187(aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1188(aA|bB)++b aAbBaAaAbBb y $& aAbBaAaAbBb
1189(?:aA|bB)++b aAbBbBaAaAb y $& aAbBbBaAaAb
1190(?:aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1191(aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1192(aA|bB)*+b bBbBbBbBbBb y $& bBbBbBbBbBb
1193(?:aA|bB)*+b bBaAbBbBaAb y $& bBaAbBbBaAb
1194(?:aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1195(aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1196(aA|bB){1,5}+b bBaAbBaAbBb y $& bBaAbBaAbBb
1197(?:aA|bB){1,5}+b aAbBaAbBbBb y $& aAbBaAbBbBb
1198(?:aA)?+b aAb y $& aAb
1199(aA)?+b aAb y $& aAb
1200(aA|bB)?+b bBb y $& bBb
1201(?:aA|bB)?+b bBb y $& bBb
1202foo(?:aA)++(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1203foo(aA)++(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1204foo(aA|bB)++(aA|bB) foobBbBbBaAaA n - foobBbBbBaAaA
1205foo(?:aA|bB)++(?:aA|bB) fooaAaAaAaAaA n - fooaAaAaAaAaA
1206foo(?:aA)*+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1207foo(aA)*+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1208foo(aA|bB)*+(aA|bB) foobBaAbBaAaA n - foobBaAbBaAaA
1209foo(?:aA|bB)*+(?:aA|bB) fooaAaAbBbBaA n - fooaAaAbBbBaA
1210foo(?:aA){1,5}+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1211foo(aA){1,5}+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1212foo(aA|bB){1,5}+(aA|bB) fooaAbBbBaAaA n - fooaAbBbBaAaA
1213foo(?:aA|bB){1,5}+(?:aA|bB) fooaAbBbBaAbB n - fooaAbBbBaAbB
1214foo(?:aA)?+(?:aA) fooaAb n - fooaAb
1215foo(aA)?+(aA) fooaAb n - fooaAb
1216foo(aA|bB)?+(aA|bB) foobBb n - foobBb
1217foo(?:aA|bB)?+(?:aA|bB) fooaAb n - fooaAb
1218foo(?:aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1219foo(aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1220foo(aA|bB)++b foobBaAbBaAbBb y $& foobBaAbBaAbBb
1221foo(?:aA|bB)++b fooaAaAbBaAaAb y $& fooaAaAbBaAaAb
1222foo(?:aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1223foo(aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1224foo(aA|bB)*+b foobBbBaAaAaAb y $& foobBbBaAaAaAb
1225foo(?:aA|bB)*+b foobBaAaAbBaAb y $& foobBaAaAbBaAb
1226foo(?:aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1227foo(aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1228foo(aA|bB){1,5}+b foobBaAaAaAaAb y $& foobBaAaAaAaAb
1229foo(?:aA|bB){1,5}+b fooaAbBaAbBbBb y $& fooaAbBaAbBbBb
1230foo(?:aA)?+b fooaAb y $& fooaAb
1231foo(aA)?+b fooaAb y $& fooaAb
1232foo(aA|bB)?+b foobBb y $& foobBb
1233foo(?:aA|bB)?+b foobBb y $& foobBb
1234
1235([^()]++|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
1236round\(([^()]++)\) _I(round(xs * sz),1) y $1 xs * sz
1237
7f69552c
YO
1238(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $1 baz3
1239(foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $& foo1bar2baz3y
1240(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $1 baz3
1241(foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $& foo1bar2baz3y
1242
1243([yX].|WORDS|[yX].|WORD)S WORDS y $1 WORD
1244(WORDS|WORLD|WORD)S WORDS y $1 WORD
1245([yX].|WORDS|WORD|[xY].)S WORDS y $1 WORD
1246(foo|fool|[zx].|money|parted)$ fool y $1 fool
1247([zx].|foo|fool|[zq].|money|parted|[yx].)$ fool y $1 fool
1248(foo|fool|[zx].|money|parted)$ fools n - -
1249([zx].|foo|fool|[qx].|money|parted|[py].)$ fools n - -
1250
1251([yX].|WORDS|[yX].|WORD)+S WORDS y $1 WORD
1252(WORDS|WORLD|WORD)+S WORDS y $1 WORD
1253([yX].|WORDS|WORD|[xY].)+S WORDS y $1 WORD
1254(foo|fool|[zx].|money|parted)+$ fool y $1 fool
1255([zx].|foo|fool|[zq].|money|parted|[yx].)+$ fool y $1 fool
1256(foo|fool|[zx].|money|parted)+$ fools n - -
1257([zx].|foo|fool|[qx].|money|parted|[py].)+$ fools n - -
1258
1259(x|y|z[QW])+(longish|loquatious|excessive|overblown[QW])+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1260(x|y|z[QW])*(longish|loquatious|excessive|overblown[QW])* xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1261(x|y|z[QW]){1,5}(longish|loquatious|excessive|overblown[QW]){1,5} xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1262
1263(x|y|z[QW])++(longish|loquatious|excessive|overblown[QW])++ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1264(x|y|z[QW])*+(longish|loquatious|excessive|overblown[QW])*+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1265(x|y|z[QW]){1,5}+(longish|loquatious|excessive|overblown[QW]){1,5}+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1266
7f69552c 1267a*(?!) aaaab n - -
e2e6a0f1
YO
1268a*(*FAIL) aaaab n - -
1269a*(*F) aaaab n - -
1270
1271(A(A|B(*ACCEPT)|C)D)(E) AB y $1 AB
1272(A(A|B(*ACCEPT)|C)D)(E) ACDE y $1$2$3 ACDCE
1273
542fa716 1274(a)(?:(?-1)|(?+1))(b) aab y $&-$1-$2 aab-a-b
c74340f9 1275(a)(?:(?-1)|(?+1))(b) abb y $1-$2 a-b
542fa716 1276(a)(?:(?-1)|(?+1))(b) acb n - -
c74340f9 1277
2bf803e2
YO
1278(foo)(\g-2) foofoo y $1-$2 foo-foo
1279(foo)(\g-2)(foo)(\g-2) foofoofoofoo y $1-$2-$3-$4 foo-foo-foo-foo
1280(([abc]+) \g-1)(([abc]+) \g{-1}) abc abccba cba y $2-$4 abc-cba
1281(a)(b)(c)\g1\g2\g3 abcabc y $1$2$3 abc
1282
1f1031fe 1283# \k<n> preceded by a literal
99ed40ff 1284/(?'n'foo) \k<n>/ ..foo foo.. y $1 foo
cb6fa888 1285/(?'n'foo) \k<n>/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
99ed40ff 1286/(?<n>foo) \k'n'/ ..foo foo.. y $1 foo
cb6fa888
NC
1287/(?<n>foo) \k'n'/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1288/(?'a1'foo) \k'a1'/ ..foo foo.. yM $+{a1} foo miniperl cannot load Tie::Hash::NamedCapture
1289/(?<a1>foo) \k<a1>/ ..foo foo.. yM $+{a1} foo miniperl cannot load Tie::Hash::NamedCapture
1290/(?'_'foo) \k'_'/ ..foo foo.. yM $+{_} foo miniperl cannot load Tie::Hash::NamedCapture
1291/(?<_>foo) \k<_>/ ..foo foo.. yM $+{_} foo miniperl cannot load Tie::Hash::NamedCapture
1292/(?'_0_'foo) \k'_0_'/ ..foo foo.. yM $+{_0_} foo miniperl cannot load Tie::Hash::NamedCapture
1293/(?<_0_>foo) \k<_0_>/ ..foo foo.. yM $+{_0_} foo miniperl cannot load Tie::Hash::NamedCapture
0f7276ab
KW
1294/(?'0'foo) bar/ - c - Group name must start with a non-digit word character
1295/(?<0>foo) bar/ - c - Group name must start with a non-digit word character
1296/(?'12'foo) bar/ - c - Group name must start with a non-digit word character
1297/(?<12>foo) bar/ - c - Group name must start with a non-digit word character
1298/(?'1a'foo) bar/ - c - Group name must start with a non-digit word character
1299/(?<1a>foo) bar/ - c - Group name must start with a non-digit word character
1300/(?''foo) bar/ - c - Group name must start with a non-digit word character
1301/(?<>foo) bar/ - c - Group name must start with a non-digit word character
1302/foo \k'n'/ - c - Reference to nonexistent named group
1303/foo \k<n>/ - c - Reference to nonexistent named group
1304/foo \k'a1'/ - c - Reference to nonexistent named group
1305/foo \k<a1>/ - c - Reference to nonexistent named group
1306/foo \k'_'/ - c - Reference to nonexistent named group
1307/foo \k<_>/ - c - Reference to nonexistent named group
1308/foo \k'_0_'/ - c - Reference to nonexistent named group
1309/foo \k<_0_>/ - c - Reference to nonexistent named group
1310/foo \k'0'/ - c - Group name must start with a non-digit word character
1311/foo \k<0>/ - c - Group name must start with a non-digit word character
1312/foo \k'12'/ - c - Group name must start with a non-digit word character
1313/foo \k<12>/ - c - Group name must start with a non-digit word character
1314/foo \k'1a'/ - c - Group name must start with a non-digit word character
1315/foo \k<1a>/ - c - Group name must start with a non-digit word character
1316/foo \k''/ - c - Group name must start with a non-digit word character
1317/foo \k<>/ - c - Group name must start with a non-digit word character
99ed40ff 1318/(?<as>as) (\w+) \k<as> (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1f1031fe
YO
1319
1320# \g{...} with a name as the argument
1321/(?'n'foo) \g{n}/ ..foo foo.. y $1 foo
cb6fa888 1322/(?'n'foo) \g{n}/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe 1323/(?<n>foo) \g{n}/ ..foo foo.. y $1 foo
cb6fa888 1324/(?<n>foo) \g{n}/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1325/(?<as>as) (\w+) \g{as} (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1326
1327# Python style named capture buffer stuff
1328/(?P<n>foo)(?P=n)/ ..foofoo.. y $1 foo
cb6fa888
NC
1329/(?P<n>foo)(?P=n)/ ..foofoo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1330/(?:(?P<n>foo)|(?P<n>bar))(?P=n)/ ..barbar.. yM $+{n} bar miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1331/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamimadam y $& madamimadam
1332/^(?P<PAL>(?P<CHAR>.)((?P>PAL)|.?)(?P=CHAR))$/ madamiamadam n - -
1333/(?P<n>foo) (?P=n)/ ..foo foo.. y $1 foo
cb6fa888 1334/(?P<n>foo) (?P=n)/ ..foo foo.. yM $+{n} foo miniperl cannot load Tie::Hash::NamedCapture
1f1031fe
YO
1335/(?P<as>as) (\w+) (?P=as) (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie
1336
1337#check that non identifiers as names are treated as the appropriate lookaround
1338(?<=bar>)foo bar>foo y $& foo
1339(?<!bar>)foo bar>foo n - -
1340(?<=bar>ABC)foo bar>ABCfoo y $& foo
1341(?<!bar>ABC)foo bar>ABCfoo n - -
1342(?<bar>)foo bar>ABCfoo y $& foo
68ba3a3f
YO
1343(?<bar>ABC)foo bar>ABCfoo y $& ABCfoo
1344
1345(?<=abcd(?<=(aaaabcd))) ..aaaabcd.. y $1 aaaabcd
1346(?=xy(?<=(aaxy))) ..aaxy.. y $1 aaxy
fae667d5
YO
1347
1348X(\w+)(?=\s)|X(\w+) Xab y [$1-$2] [-ab]
594d7033
YO
1349
1350#check that branch reset works ok.
3bce0506 1351(?|(a)) a y $1-$+-$^N a-a-a
594d7033
YO
1352(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) d!o!da y $1-$2-$3 !o!-o-a
1353(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) aabc y $1-$2-$3 a--c
1354(?|a(.)b|d(.(o).)d|i(.)(.)j)(.) ixyjp y $1-$2-$3 x-y-p
1355(?|(?|(a)|(b))|(?|(c)|(d))) a y $1 a
1356(?|(?|(a)|(b))|(?|(c)|(d))) b y $1 b
1357(?|(?|(a)|(b))|(?|(c)|(d))) c y $1 c
1358(?|(?|(a)|(b))|(?|(c)|(d))) d y $1 d
1359(.)(?|(.)(.)x|(.)d)(.) abcde y $1-$2-$3-$4-$5- b-c--e--
cbf4a129 1360(\N)(?|(\N)(\N)x|(\N)d)(\N) abcde y $1-$2-$3-$4-$5- b-c--e--
cb6fa888
NC
1361(?|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1362(?|(?<foo>x)|(?<bar>y)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1363(?|(?<bar>y)|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
1364(?<bar>)(?|(?<foo>x)) x yM $+{foo} x miniperl cannot load Tie::Hash::NamedCapture
fd4be6f0
FC
1365# Used to crash, because the last branch was ignored when the parens
1366# were counted:
1367(?|(b)|()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(a)) a y $& a
ee91d26e 1368
3e901dc0
YO
1369#Bug #41492
1370(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) a y $& a
1371(?(DEFINE)(?<A>(?&B)+)(?<B>a))(?&A) aa y $& aa
61525e55 1372\x{100}?(??{""})xxx xxx y $& xxx
e1d1eefb
YO
1373
1374foo(\R)bar foo\r\nbar y $1 \r\n
1375foo(\R)bar foo\nbar y $1 \n
1376foo(\R)bar foo\rbar y $1 \r
1377
1378foo(\R+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1379(\V+)(\R) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r\n
1380(\R+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1381foo(\R)bar foo\x{85}bar y $1 \x{85}
1382(\V)(\R) foo\x{85}bar y $1-$2 o-\x{85}
1383(\R)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1384foo(\R)bar foo\r\nbar y $1 \r\n
1385(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1386(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1387foo(\R)bar foo\r\nbar y $1 \r\n
1388(\V)(\R) foo\r\nbar y $1-$2 o-\r\n
1389(\R)(\V) foo\r\nbar y $1-$2 \r\n-b
1390foo(\R)bar foo\rbar y $1 \r
1391(\V)(\R) foo\rbar y $1-$2 o-\r
1392(\R)(\V) foo\rbar y $1-$2 \r-b
1393
1394foo(\v+)bar foo\r\n\x{85}\r\n\nbar y $1 \r\n\x{85}\r\n\n
1395(\V+)(\v) foo\r\n\x{85}\r\n\nbar y $1-$2 foo-\r
1396(\v+)(\V) foo\r\n\x{85}\r\n\nbar y $1-$2 \r\n\x{85}\r\n\n-b
1397foo(\v)bar foo\x{85}bar y $1 \x{85}
1398(\V)(\v) foo\x{85}bar y $1-$2 o-\x{85}
1399(\v)(\V) foo\x{85}bar y $1-$2 \x{85}-b
1400foo(\v)bar foo\rbar y $1 \r
1401(\V)(\v) foo\rbar y $1-$2 o-\r
1402(\v)(\V) foo\rbar y $1-$2 \r-b
1403
1404
1405foo(\h+)bar foo\t\x{A0}bar y $1 \t\x{A0}
1406(\H+)(\h) foo\t\x{A0}bar y $1-$2 foo-\t
1407(\h+)(\H) foo\t\x{A0}bar y $1-$2 \t\x{A0}-b
1408foo(\h)bar foo\x{A0}bar y $1 \x{A0}
1409(\H)(\h) foo\x{A0}bar y $1-$2 o-\x{A0}
1410(\h)(\H) foo\x{A0}bar y $1-$2 \x{A0}-b
1411foo(\h)bar foo\tbar y $1 \t
1412(\H)(\h) foo\tbar y $1-$2 o-\t
1413(\h)(\H) foo\tbar y $1-$2 \t-b
5339e136 1414
cbf4a129
RGS
1415.*\z foo\n y -$&- --
1416\N*\z foo\n y -$&- --
1417.*\Z foo\n y -$&- -foo-
1418\N*\Z foo\n y -$&- -foo-
225593e1 1419^(?:(\d)x)?\d$ 1 y ${\(defined($1)?1:0)} 0
60f65011 1420.*?(?:(\w)|(\w))x abx y $1-$2 b-
639081d6
YO
1421
14220{50} 000000000000000000000000000000000000000000000000000 y - -
906cdd2b
HS
1423^a?(?=b)b ab y $& ab # Bug #56690
1424^a*(?=b)b ab y $& ab # Bug #56690
2811b836
B
1425/>\d+$ \n/ix >10\n y $& >10
1426/>\d+$ \n/ix >1\n y $& >1
1427/\d+$ \n/ix >10\n y $& 10
1428/>\d\d$ \n/ix >10\n y $& >10
1429/>\d+$ \n/x >10\n y $& >10
44d268c3
NC
1430
1431# Two regressions in 5.8.x (only) introduced by change 30638
1432# Simplification of the test failure in XML::LibXML::Simple:
1433/^\s*i.*?o\s*$/s io\n io y - -
1434# As reported in #59168 by Father Chrysostomos:
1435/(.*?)a(?!(a+)b\2c)/ baaabaac y $&-$1 baa-ba
aff3edb5
YO
1436# [perl #60344] Regex lookbehind failure after an (if)then|else in perl 5.10
1437/\A(?(?=db2)db2|\D+)(?<!processed)\.csv\z/xms sql_processed.csv n - -
24d786f4 1438/\N{U+0100}/ \x{100} y $& \x{100} # Bug #59328
ff3f963a
KW
1439/[a\N{U+0100}]/ \x{100} y $& \x{100}
1440/[a\N{U+0100}]/ a y $& a
1441
850b7ec9 1442# Verify that \N{U+...} forces Unicode rules
ff3f963a
KW
1443/\N{U+41}\x{c1}/i a\x{e1} y $& a\x{e1}
1444/[\N{U+41}\x{c1}]/i \x{e1} y $& \x{e1}
b6d67071 1445'\N{U+41}' A y $& A # Even for single quoted patterns
75697d6e 1446/\N{}\xe4/i \xc4 y $& \xc4 # Empty \N{} should change /d to /u
ff3f963a 1447
11454c59 1448[\s][\S] \x{a0}\x{a0} n - - # Unicode complements should not match same character
3cf20fa2
KW
1449
1450# was generating malformed utf8
1451'[\x{100}\xff]'i \x{ff} y $& \x{ff}
e120390b
B
1452
1453((??{ "(?:|)" }))\s C\x20 y - -
40863337 1454
ff3f963a
KW
1455# Verify that \ escapes the { after \N, and causes \N to match non-newline
1456abc\N\{U+BEEF} abc\n{UBEEF} n
92e8e650
KW
1457abc\N\{U+BEEF\} abc.{UBEEF} y $& abc.{UBEEF}
1458[abc\N\{U+BEEF\}] - c - \\N in a character class must be a named character
ff3f963a
KW
1459
1460# Verify that \N can be trailing and causes \N to match non-newline
1461abc\N abcd y $& abcd
1462abc\N abc\n n
1463
1464# Verify get errors. For these, we need // or else puts it in single quotes,
c3c41406 1465# and bypasses the lexer.
ff3f963a 1466/\N{U+}/ - c - Invalid hexadecimal number
f065e1e6 1467/[\N{U+}]/ - c - Invalid hexadecimal number
ff3f963a 1468/abc\N{def/ - c - Missing right brace
4cbd7e22 1469/\N{U+4AG3}/ - c - Invalid hexadecimal number
f065e1e6 1470/[\N{U+4AG3}]/ - c - Invalid hexadecimal number
c3c41406
KW
1471
1472# And verify that in single quotes which bypasses the lexer, the regex compiler
1473# figures it out.
1474\N{U+} - c - Invalid hexadecimal number
1475[\N{U+}] - c - Invalid hexadecimal number
b9c48b5b 1476\N{U+4AG3} - c - Invalid hexadecimal number
c3c41406 1477[\N{U+4AG3}] - c - Invalid hexadecimal number
ff4e2b11
DIM
1478abc\N{def} - c - \\N{NAME} must be resolved by the lexer
1479abc\N{U+4AG3 - c - Missing right brace on \\N{}
1480abc\N{def - c - Missing right brace on \\N{}
1481abc\N{ - c - Missing right brace on \\N{}
c3c41406
KW
1482
1483# Verify that under /x that still cant have space before left brace
1484/abc\N {U+41}/x - c - Missing braces
1485/abc\N {SPACE}/x - c - Missing braces
ff3f963a 1486
4cbd7e22
FC
1487# Verifies catches hex errors
1488/\N{U+0xBEEF}/ - c - Invalid hexadecimal number
1489# Used to be an error, but not any more:
1490/\N{U+BEEF.BEAD}/ - c -
ff3f963a 1491
c3c41406
KW
1492# Verify works in single quotish context; regex compiler delivers slightly different msg
1493# \N{U+BEEF.BEAD} succeeds here, because can't completely hide it from the outside.
b9c48b5b 1494\N{U+0xBEEF} - c - Invalid hexadecimal number
b41acb1e
KW
1495\c` - ac - \"\\c`\" is more clearly written simply as \"\\ \"
1496\c1 - ac - \"\\c1\" is more clearly written simply as \"q\"
1497\c@ \0 y $& \0
1498\cA \001 y $& \001
1499\cB \002 y $& \002
1500\cC \003 y $& \003
1501\cI \011 y $& \011
1502\cJ \012 y $& \012
1503\cR \022 y $& \022
1504\cS \023 y $& \023
1505\cX \030 y $& \030
1506\cY \031 y $& \031
1507\cZ \032 y $& \032
1508\c[ \033 y $& \033
1509\c\X \034X y $& \034X
1510\c] \035 y $& \035
1511\c^ \036 y $& \036
1512\c_ \037 y $& \037
1513\c? \177 ay $& \177
1514\c? \x9F ey $& \x9F \c? is APC on EBCDIC
fa1639c5
KW
1515\400 \x{100} y $& \x{100}
1516\600 \x{180} y $& \x{180}
1517\777 \x{1FF} y $& \x{1FF}
1518[a\400] \x{100} y $& \x{100}
1519[b\600] \x{180} y $& \x{180}
1520[c\777] \x{1FF} y $& \x{1FF}
f0a2b745
KW
1521\o{120} \x{50} y $& \x{50}
1522\o{400} \x{100} y $& \x{100}
1523\o{1000} \x{200} y $& \x{200}
1524[a\o{120}] \x{50} y $& \x{50}
1525[a\o{400}] \x{100} y $& \x{100}
1526[a\o{1000}] \x{200} y $& \x{200}
fa1639c5 1527
726ee55d 1528# The below were inserting a NULL
f1e1b256
YO
1529\87 87 c - Reference to nonexistent group in regex
1530a\87 a87 c - Reference to nonexistent group in regex
1531a\97 a97 c - Reference to nonexistent group in regex
726ee55d 1532
0c2990d6
DM
1533# avoid problems with 32-bit signed integer overflow
1534
1535(.)\g2147483648} x c - Reference to nonexistent group in regex
1536(.)\g2147483649} x c - Reference to nonexistent group in regex
1537(.)\g2147483650} x c - Reference to nonexistent group in regex
1538(.)\g4294967296} x c - Reference to nonexistent group in regex
1539(.)\g4294967297} x c - Reference to nonexistent group in regex
1540(.)\g4294967298} x c - Reference to nonexistent group in regex
1541a(.)\g2147483648} x c - Reference to nonexistent group in regex
1542a(.)\g2147483649} x c - Reference to nonexistent group in regex
1543a(.)\g2147483650} x c - Reference to nonexistent group in regex
1544a(.)\g4294967296} x c - Reference to nonexistent group in regex
1545a(.)\g4294967297} x c - Reference to nonexistent group in regex
1546a(.)\g4294967298} x c - Reference to nonexistent group in regex
1547
1548(.)\g{2147483648} x c - Reference to nonexistent group in regex
1549(.)\g{2147483649} x c - Reference to nonexistent group in regex
1550(.)\g{2147483650} x c - Reference to nonexistent group in regex
1551(.)\g{4294967296} x c - Reference to nonexistent group in regex
1552(.)\g{4294967297} x c - Reference to nonexistent group in regex
1553(.)\g{4294967298} x c - Reference to nonexistent group in regex
1554a(.)\g{2147483648} x c - Reference to nonexistent group in regex
1555a(.)\g{2147483649} x c - Reference to nonexistent group in regex
1556a(.)\g{2147483650} x c - Reference to nonexistent group in regex
1557a(.)\g{4294967296} x c - Reference to nonexistent group in regex
1558a(.)\g{4294967297} x c - Reference to nonexistent group in regex
1559a(.)\g{4294967298} x c - Reference to nonexistent group in regex
1560
b41acb1e
KW
1561(.)\2147483648 b\o{214}7483648 ya $1 b \d not converted to native; \o{} is
1562(.)\2147483649 b\o{214}7483649 ya $1 b \d not converted to native; \o{} is
1563(.)\2147483650 b\o{214}7483650 ya $1 b \d not converted to native; \o{} is
1564(.)\4294967296 b\o{42}94967296 ya $1 b \d not converted to native; \o{} is
1565(.)\4294967297 b\o{42}94967297 ya $1 b \d not converted to native; \o{} is
1566(.)\4294967298 b\o{42}94967298 ya $1 b \d not converted to native; \o{} is
1567a(.)\2147483648 ab\o{214}7483648 ya $1 b \d not converted to native; \o{} is
1568a(.)\2147483649 ab\o{214}7483649 ya $1 b \d not converted to native; \o{} is
1569a(.)\2147483650 ab\o{214}7483650 ya $1 b \d not converted to native; \o{} is
1570a(.)\4294967296 ab\o{42}94967296 ya $1 b \d not converted to native; \o{} is
1571a(.)\4294967297 ab\o{42}94967297 ya $1 b \d not converted to native; \o{} is
1572a(.)\4294967298 ab\o{42}94967298 ya $1 b \d not converted to native; \o{} is
0c2990d6 1573
c99e91e9 1574# The below was inserting a NULL into the character class.
073b366a
KW
1575[\8\9] \000 Sn - -
1576[\8\9] - sc $& Unrecognized escape \\8 in character class
1577[\8\9] 8 Sy $& 8
1578[\8\9] 9 Sy $& 9
c99e91e9
KW
1579
1580# Verify that reads 1-3 octal digits, and that \_ works in char class
073b366a
KW
1581[\0] \000 Sy $& \000
1582[\0] - sc - Need exactly 3 octal digits
1583[\07] \007 Sy $& \007
1584[\07] - sc - Need exactly 3 octal digits
1585[\07] 7\000 Sn - -
1586[\07] - sc - Need exactly 3 octal digits
c99e91e9
KW
1587[\006] \006 y $& \006
1588[\006] 6\000 n - -
1589[\0005] \0005 y $& \000
1590[\0005] 5\000 y $& 5
1591[\_] _ y $& _
1592
779bcb7d
NC
1593# RT #79152
1594(q1|.)*(q2|.)*(x(a|bc)*y){2,} xayxay y $& xayxay
1595(q1|.)*(q2|.)*(x(a|bc)*y){2,3} xayxay y $& xayxay
1596(q1|z)*(q2|z)*z{15}-.*?(x(a|bc)*y){2,3}Z zzzzzzzzzzzzzzzz-xayxayxayxayZ y $& zzzzzzzzzzzzzzzz-xayxayxayxayZ
1597
20dbff7c 1598(?:(?:)foo|bar|zot|rt78356) foo y $& foo
e40e74fe 1599/\xe0\pL/i \xc0a y $& \xc0a
1411dba4
KW
1600
1601# RT #85528
1602(?{})[\x{100}] \x{100} y $& \x{100}
6241f69e
KW
1603
1604# RT #85964
af302e7f 1605^m?(\S)(.*)\1$ aba y $1 a
6241f69e 1606^m?(\S)(.*)\1$ \tb\t n - -
af302e7f 1607^m?(\s)(.*)\1$ \tb\t y $1 \t
6241f69e 1608^m?(\s)(.*)\1$ aba n - -
af302e7f 1609^m?(\W)(.*)\1$ :b: y $1 :
6241f69e 1610^m?(\W)(.*)\1$ aba n - -
af302e7f 1611^m?(\w)(.*)\1$ aba y $1 a
6241f69e 1612^m?(\w)(.*)\1$ :b: n - -
af302e7f 1613^m?(\D)(.*)\1$ aba y $1 a
6241f69e 1614^m?(\D)(.*)\1$ 5b5 n - -
af302e7f 1615^m?(\d)(.*)\1$ 5b5 y $1 5
6241f69e 1616^m?(\d)(.*)\1$ aba n - -
f6a766d5 1617
ac33c516
KW
1618^_?[^\W_0-9]\w\z \xAA\x{100} y $& \xAA\x{100} [perl #127537]
1619
f6a766d5
KW
1620# 17F is 'Long s'; This makes sure the a's in /aa can be separate
1621/s/ai \x{17F} y $& \x{17F}
1622/s/aia \x{17F} n - -
1623/s/aia S y $& S
1624/(?aia:s)/ \x{17F} n - -
1625/(?aia:s)/ S y $& S
827f5bb8
KW
1626
1627# Normally 1E9E generates a multi-char fold, but not in inverted class;
1628# See [perl #89750]. This makes sure that the simple fold gets generated
1629# in that case, to DF.
073b366a 1630/[^\x{1E9E}]/i \x{DF} Sn - -
1380b51d
DM
1631
1632# RT #96354
1633/^.*\d\H/ X1 n - -
1634/^.*\d\V/ X1 n - -
1635
45376db6
KW
1636# \p{L_} was being misinterpreted as \p{L}. L_ matches cased letters, which
1637# the ideograph below isn't, whereas it does match L
1638/^\p{L_}/ \x{3400} n - -
1639/^\p{L}/ \x{3400} y $& \x{3400}
1640
fd0f00a9 1641# RT #89774
073b366a 1642/[s\xDF]a/ui ssa Sy $& ssa
9d53c457 1643/[s\xDF]a/ui sa y $& sa
fd0f00a9 1644
e47f2755 1645# RT #99928
1978b668 1646/^\R\x0A$/ \x0D\x0A n - -
e47f2755 1647
7b8a8069 1648/ff/i \x{FB00}\x{FB01} y $& \x{FB00}
7c1b9f38 1649/ff/i \x{FB01}\x{FB00} y $& \x{FB00}
7b8a8069 1650/fi/i \x{FB01}\x{FB00} y $& \x{FB01}
7c1b9f38 1651/fi/i \x{FB00}\x{FB01} y $& \x{FB01}
2866decb
DM
1652#
1653# Make sure we don't see code blocks where there aren't, and vice-versa
1654(?#( (?{1+)a a y - -
1655'a# (?{1+'x a y - -
1656ab[(?{1] ab1 y - -
1657ab[(?{1\](?{2] ab2 y - -
1658ab(?{"["})cd abcd y - -
e4a2df84
DM
1659ab(??{"[x]"})cd abxcd y - -
1660ab\[(??{1})c ab[1c y - -
1661ab\\[(??{1;})]c ab\\;c y - -
1662ab\\\[(??{1})c ab\\[1c y - -
1663ab[c\](??{"]d abcd y - -
1664ab[c\\](??{"[x]"})d ab\\xd y - -
1665ab[c\\\](??{"x"})]{3}d ab\\](d y - -
7b8a8069 1666
e067297c
KW
1667# These test that doesn't cut-off matching too soon in the string for
1668# multi-char folds
1669/ffiffl/i abcdef\x{FB03}\x{FB04} y $& \x{FB03}\x{FB04}
1670/\xdf\xdf/ui abcdefssss y $& ssss
1671
7a2d0ccc
KW
1672/st/i \x{DF}\x{FB05} y $& \x{FB05}
1673/ssst/i \x{DF}\x{FB05} y $& \x{DF}\x{FB05}
88b3a463
KW
1674/[s]s/i \x{DF} n - -
1675/s[s]/i \x{DF} n - -
7a2d0ccc 1676
4f03b4b6
KW
1677# [perl #101970]
1678/[[:lower:]]/i \x{100} y $& \x{100}
1679/[[:upper:]]/i \x{101} y $& \x{101}
1680
ed178f65
KW
1681# Was matching 'ss' only and failing the entire match, not seeing the
1682# alternative that would succeed
bb914485
KW
1683/s\xDF/ui \xDFs y $& \xDFs
1684/sst/ui s\N{LATIN SMALL LIGATURE ST} y $& s\N{LATIN SMALL LIGATURE ST}
1685/sst/ui s\N{LATIN SMALL LIGATURE LONG S T} y $& s\N{LATIN SMALL LIGATURE LONG S T}
ed178f65 1686
35245af4 1687# /i properties shouldn't match more than the property itself
ea317ccb
KW
1688/[[:ascii:]]/i \N{KELVIN SIGN} n - -
1689
dab0c3e7
KW
1690# [[:lower:]]/i and [[:upper:]]/i should match what \p{Lower} and \p{Upper} do.
1691# which is \p{Cased}, not \p{Alpha},
1692/[[:lower:]]/i \N{U+3400} n - -
1693/[[:upper:]]/i \N{U+01BB} n - -
1694
5d103fec
KW
1695# [perl #110648]
1696[^\p{Alphabetic}] \x{100} n - -
1697
b4069bca
KW
1698# [perl #111400]. Tests the first Y/N boundary above 255 for each of these.
1699/[[:alnum:]]/ \x{2c1} y - -
1700/[[:alnum:]]/ \x{2c2} n - -
1701/[[:alpha:]]/ \x{2c1} y - -
1702/[[:alpha:]]/ \x{2c2} n - -
1703/[[:graph:]]/ \x{377} y - -
1704/[[:graph:]]/ \x{378} n - -
1705/[[:lower:]]/ \x{100} n - -
1706/[[:lower:]]/ \x{101} y - -
1707/[[:lower:]]/ \x{102} n - -
1708/[[:print:]]/ \x{377} y - -
1709/[[:print:]]/ \x{378} n - -
1710/[[:punct:]]/ \x{37D} n - -
1711/[[:punct:]]/ \x{37E} y - -
1712/[[:punct:]]/ \x{388} n - -
1713/[[:upper:]]/ \x{100} y - -
1714/[[:upper:]]/ \x{101} n - -
1715/[[:word:]]/ \x{2c1} y - -
1716/[[:word:]]/ \x{2c2} n - -
1717
4adb7801
FC
1718# [perl #113400]
1719/syntax OK\s+\z/si t/bin/good.pl syntax OK\n y - -
b4069bca 1720
df826430
YO
1721/^(.*?)\s*\|\s*(?:\/\s*|)'(.+)'$/ text|'sec' y <$1><$2> <text><sec>
1722/^(foo|)bar$/ bar y <$&> <bar>
1723/^(foo||baz)bar$/ bar y <$&> <bar>
1724/^(foo||baz)bar$/ bazbar y <$1> <baz>
1725/^(foo||baz)bar$/ foobar y <$1> <foo>
1726
1727/^(?:foo|)bar$/ bar y <$&> <bar>
1728/^(?:foo||baz)bar$/ bar y <$&> <bar>
1729/^(?:foo||baz)bar$/ bazbar y <$&> <bazbar>
1730/^(?:foo||baz)bar$/ foobar y <$&> <foobar>
1731
1732/^(?i:foo|)bar$/ bar y <$&> <bar>
1733/^(?i:foo||baz)bar$/ bar y <$&> <bar>
1734/^(?i:foo||baz)bar$/ bazbar y <$&> <bazbar>
1735/^(?i:foo||baz)bar$/ foobar y <$&> <foobar>
1736
f6033a9d
DM
1737# $^N, $+ on backtrackracking
1738# BRANCH
1739^(.)(?:(..)|B)[CX] ABCDE y $^N-$+ A-A -
1740# TRIE
1741^(.)(?:BC(.)|B)[CX] ABCDE y $^N-$+ A-A -
1742# CURLYX
1743^(.)(?:(.)+)*[BX] ABCDE y $^N-$+ A-A -
1744# CURLYM
1745^(.)(BC)* ABCDE y $^N-$+ BC-BC -
1746^(.)(BC)*[BX] ABCDE y $^N-$+ A-A -
1747# CURLYN
1748^(.)(B)*.[DX] ABCDE y $^N-$+ B-B -
1749^(.)(B)*.[CX] ABCDE y $^N-$+ A-A -
1750
cec72654
DM
1751# using 'return' in code blocks
1752^(A)(?{"xyz"})B$ AB y $1-$^R A-xyz -
1753^(A)(?{return "xyz"})B$ AB y $1-$^R A-xyz -
1754^(A)((??{"xyz"}))$ Axyz y $1-$2 A-xyz -
1755^(A)((??{return "xyz"}))$ Axyz y $1-$2 A-xyz -
1756^(A)((?(?{1})abc|xyz))$ Aabc y $1-$2 A-abc -
1757^(A)((?(?{0})abc|xyz))$ Axyz y $1-$2 A-xyz -
1758^(A)((?(?{return 1})abc|xyz))$ Aabc y $1-$2 A-abc -
1759^(A)((?(?{return 0})abc|xyz))$ Axyz y $1-$2 A-xyz -
1760
79646418
DM
1761# using 'return' in code blocks with additional scopes to pop
1762^(A)(?{ { 1; return "xyz"} })B$ AB y $1-$^R A-xyz -
1763^(A)((??{ { 1; return "xyz" } }))$ Axyz y $1-$2 A-xyz -
1764^(A)((?(?{ { 1; return 1 } })abc|xyz))$ Aabc y $1-$2 A-abc -
1765^(A)((?(?{ { 1; return 0 } })abc|xyz))$ Axyz y $1-$2 A-xyz -
1766
ec841a27
DM
1767# pattern modifier flags should propagate into returned (??{}) pattern
1768# p,d,l not tested
1769
1770/^(a)((??{"b"}))$/i AB y $1-$2 A-B -
1771/^(A)((??{'B$'}))(\nC)$/m AB\nC y $1-$2-$3 A-B-\nC -
1772/^(A)((??{'.'}))(B)$/s A\nB y $1-$2-$3 A-\n-B -
1773/^(A) ((??{' .'}))(B)$/x A B y $1-$2-$3 A- -B -
1774/^((??{'\d'}))$/a \x{660} n - -
1775/^(??{"s"})$/i \x{17F} y - -
1776/^(??{"s"})$/ia \x{17F} y - -
1777/^(??{"s"})$/iaa \x{17F} n - -
1778/^(??{'\w'})$/u \x{AA} y - -
1779
a8d1f4b4
DM
1780# #113670 ensure any captures to the right are invalidated when CURLY
1781# and CURLYM backtrack
1782
1783^(?:(X)?(\d)|(X)?(\d\d))$ X12 y $1-$2-$3-$4 --X-12
1784^(?:(XX)?(\d)|(XX)?(\d\d))$ XX12 y $1-$2-$3-$4 --XX-12
1785
190c1910
YO
1786# rt 113770
1787\A(?>\[(?:(?:)(?:R){1}|T|V?|A)\])\z [A] y $& [A]
ac7af3f6
YO
1788# rt 114068
1789/( [^z] $ [^z]+)/xm aa\nbb\ncc\n y $1 a\nbb\ncc\n
d8661376
KW
1790
1791# [perl #114220]
1792/[\h]/ \x{A0} y $& \xA0
1793/[\H]/ \x{BF} y $& \xBF
1794/[\H]/ \x{A0} n - -
1795/[\H]/ \x{A1} y $& \xA1
1796
5a279aa0
KW
1797[^\n]+ \nb y $& b
1798[^\n]+ a\n y $& a
1799
0658cdde
KW
1800# /a has no effect on properties
1801(?a:\p{Any}) \x{100} y $& \x{100}
1802(?aa:\p{Any}) \x{100} y $& \x{100}
1803
7a4d6ad6
KW
1804\w \x{200C} y $& \x{200C}
1805\W \x{200C} n - -
1806\w \x{200D} y $& \x{200D}
1807\W \x{200D} n - -
1808
7dff6b46 1809/^(?d:\xdf|_)*_/i \x{17f}\x{17f}_ y $& \x{17f}\x{17f}_
6502e081
DM
1810#
1811# check that @-, @+ count chars, not bytes; especially if beginning of
1812# string is not copied
1813
1814(\x{100}) \x{2000}\x{2000}\x{2000}\x{100} y $-[0]:$-[1]:$+[0]:$+[1] 3:3:4:4
7dff6b46 1815
565fc1bb
KW
1816^\R{2}$ \r\n\r\n y $& \r\n\r\n
1817
4063ade8
KW
1818/^\D{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1819/^\S{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1820/^\W{11}/a \x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF}\x{10FFFF} n - -
1821
d87fc68d 1822# [ perl #114272]
41043df0 1823\Vn \xFFn/ y $& \xFFn
d87fc68d 1824
709d08c2 1825# These mostly exercize various paths in the optimizer
b25a1036 1826/(?l:a?\w)/ b y $& b
709d08c2
KW
1827/(?l:a?\D)/ b y $& b
1828^_?[^\S_0-9]\w*\z \t y $& \t
4d68ffa0 1829m?^xy\?$? xy? y $& xy?
709d08c2
KW
1830a?\X a\x{100} y $& a\x{100}
1831a?\R a\n y $& a\n
1832^a?\N$ a\n y $& a
1833\N?a \na y $& a
1834/\s?\s/l \t y $& \t
1835/\s?\d/l 3 y $& 3
1836/\s?\S/l A y $& A
b25a1036 1837
aed7b151
DM
1838# check we have the right utf8ness as we switch back and forth between
1839# patterns
1840^(\x{100}|a)(??{ qr/.?\xF7/d}) a_\xF7 y - -
1841
c37d14f9
KW
1842# [perl #118375]
1843/(a|(bc)){0,0}?xyz/ xyz y $& xyz
1844/( a | ( bc ) ) {0,0} ? xyz/x xyz y $& xyz
1845
b75763d6
YO
1846/(a|(bc)){0,0}+xyz/ xyz y $& xyz
1847/( a | ( bc ) ) {0,0} + xyz/x xyz y $& xyz
1848
5c53df94
YO
1849(A(*PRUNE)B|A(*PRUNE)C) AC n - -
1850(A(*PRUNE)B|A(*PRUNE)D|A(*PRUNE)C) AC n - -
1851(A(*PRUNE)B|A(*PRUNE)C|A(*PRUNE)D) AC n - -
1852((A(*PRUNE)B|A(*PRUNE)C)) AC n - -
1853((A(*PRUNE)B|A(*PRUNE)D|A(*PRUNE)C)) AC n - -
1854((A(*PRUNE)B|A(*PRUNE)C|A(*PRUNE)D)) AC n - -
1855
b8f6efdd
YO
1856A+?(*THEN)BC AAABC y $& ABC
1857A+?(*PRUNE)BC AAABC y $& ABC
1858A+(*THEN)BC AAABC y $& AAABC
1859A+(*PRUNE)BC AAABC y $& AAABC
1860A+?(*THEN)BC(?{}) AAABC y $& ABC
1861A+?(*PRUNE)BC(?{}) AAABC y $& ABC
1862A+(*THEN)BC(?{}) AAABC y $& AAABC
1863A+(*PRUNE)BC(?{}) AAABC y $& AAABC
c30fc27b
DM
1864/[#]/ a#b y $& #
1865/[#]b/ a#b y $& #b
1866/[#]/x a#b y $& #
1867/[#]b/x a#b y $& #b
1868/[#](?{})/x a#b y $& #
1869/[#](??{'b'})/x a#b y $& #b
1870/(?#)(?{})b/ a#b y $& b
1871/(?#)(??{'b'})/ a#b y $& b
1872/[(?#](?{})b/ a#b y $& #b
1873/[(?#](??{'b'})/ a#b y $& #b
1874/(?#)(?{})b/x a#b y $& b
1875/(?#)(??{'b'})/x a#b y $& b
602afc9b 1876
c5de0829
JK
1877# RT #119069: PCRE regression test: no segfault
1878^(?=(a)){0}b(?1) back y $& ba
1879# RT #119071: PCRE regression test: No warning of infinite regression
1880(?:(a(*SKIP)b)){0}(?:(?1)|ac) x n - -
1881# RT #119073: PCRE regression test: {0} => NOTHING optimization
1882(?1)(?:(b)){0} b y $& b
77ebeeba
KW
1883# RT #120041
1884^A*\z y $&
8ee4c05d
KW
1885/\N* /x ab y $& ab # Under /x was ignoring the '*'
1886/\N (?#comment) * /x ab y $& ab # likewise
602afc9b 1887
099ec7dc
YO
1888# RT #120600: Variable length lookbehind is not variable
1889(?<W>a)(?<BB>(?=(?&W))(?<=(?&W)))(?&BB) aa y $& a # test repeated recursive patterns
3c075fea
KW
1890
1891# This group is from RT #121144
1892/^\S+=/d \x{3a3}=\x{3a0} y $& \x{3a3}=
1893/^\S+=/u \x{3a3}=\x{3a0} y $& \x{3a3}=
1894
d54614d3
DM
1895# utf8 cache length panics
1896\x{100}[xy]\x{100}{2} \x{100}y\x{100}\x{100} y $& \x{100}y\x{100}\x{100}
1897\x{100}a{2,3} \x{100}aaa y $& \x{100}aaa
d6ef1678 1898^x?abc?de abcde y $& abcde
d54614d3 1899
8c33f579
DM
1900'(?-m:^abc)'m abcde y $& abc
1901'(?-m:^abc)'m x\nabcde n - -
1902
4620cb61 1903# RT #121248 - segfault
4620cb61
DM
1904/^[+]([^(]+)$/mi li n - -
1905
d1b2014a
YO
1906# RT #121299 - Inconsistent behavior with backreferences nested inside subpattern references
1907/(.)((o)\1)(?2)/ fofof y $2 of
1908/(.)(?2)((\1)(?4)(\1))/ fffffff y $1 f
1909/(.)(?2)((.)(?4)(\1))/ foffoff y $2 off
1910/^(.\2?)(.)(?1)$/ abcb y $2 b
1911/^(.\1?)(?1)$/ aba y $1 a
1912/^ (\3(?2)\3)? ((.)) (?1) $/x aaba y $2 a
1913/^ (a|\3(?1)\2|(?2)) ((b|c)(?4)?) (?1) (d(?1)) $/x abbcdcabbda y $2 b
845ab12d
YO
1914
1915# RT #121321 - perl 5.19.10 infinite loops on backrefs > number of capture buffers (npar) where npar>9
1916/(a)\2/ a\2 c - Reference to nonexistent group in regex
1917/(a)(b)\3/ ab\3 c - Reference to nonexistent group in regex
1918/(a)(b)(c)\4/ abc\4 c - Reference to nonexistent group in regex
1919/(a)(b)(c)(d)\5/ abcd\5 c - Reference to nonexistent group in regex
1920/(a)(b)(c)(d)(e)\6/ abcde\6 c - Reference to nonexistent group in regex
1921/(a)(b)(c)(d)(e)(f)\7/ abcdef\7 c - Reference to nonexistent group in regex
1922/(a)(b)(c)(d)(e)(f)(g)(h)(i)\10/ abcdefghi\10 y $& abcdefghi\10
1923/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)\11/ abcdefghij\11 y $& abcdefghij\11
1924/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12/ abcdefghijk\12 y $& abcdefghijk\12
1925/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\13\14/ abcdefghijk\12\13\14 y $& abcdefghijk\12\13\14
4f6684fe
DM
1926
1927\d<(.*?)> a<> n - -
000dfd2d
DM
1928[bcd].{2,3}aaaa XbXaaaaa y - -
1929[bcd].{2,3}aaaa Xb\x{100}aaaaa y - -
7742aa66 1930'\Awibble\z'm wibble y - -
890fbec8 1931/(alias|status)es$/i Statuses y $1 Status # [perl #121778]
f6f22b1f 1932/( (?&solution) | % ) \Z (?(DEFINE) (?<solution>7\%\ solution) )/x 7% solution y $1 7% solution # [perl #122890]
9c6c921b 1933(.)(?{$~=$^N}) \x{100} y $~ \x{100} # [perl #123135]
4f6684fe 1934
7475a24f 1935/[a-z]/i \N{KELVIN SIGN} y $& \N{KELVIN SIGN}
d3c865f7
KW
1936/[A-Z]/ia \N{KELVIN SIGN} y $& \N{KELVIN SIGN}
1937/[A-Z]/iaa \N{KELVIN SIGN} n - -
7475a24f
KW
1938/[A-Z]/i \N{LATIN SMALL LETTER LONG S} y $& \N{LATIN SMALL LETTER LONG S}
1939
88203927
DM
1940# RT #123840: these used to hang in re_intuit_start
1941/w\zxy?\z/i \x{100}a\x{80}a n - -
1942/w\z\R\z/i \x{100}a\x{80}a n - -
1943
9a7bb2f7
KW
1944/(a+){1}+a/ aaa n - - # [perl #125825]
1945
0f8d761c
YO
1946^((?(?=x)xb|ya)z) xbz y $1 xbz
1947^((?(?=x)xb|ya)z) yaz y $1 yaz
1948^((?(?!y)xb|ya)z) xbz y $1 xbz
1949^((?(?!y)xb|ya)z) yaz y $1 yaz
1950^((?(?!)xb|ya)z) xbz n - -
6625d926 1951^((?(?!)xb|ya)z) yaz y $1 yaz # [perl-126222]
0f8d761c 1952
fee50582
YO
1953foo(*ACCEPT:foo) foo y $::REGMARK foo
1954(foo(*ACCEPT:foo)) foo y $::REGMARK foo
1955A(*FAIL:foo)[BC] A n $::REGERROR foo
361446f1 1956
c642c6b2 1957\N(?#comment){SPACE} A c - Missing braces on \\N{}
361446f1 1958ab(?#Comment){2}c abbc y $& abbc
163a633c
KW
1959\p A A c - Character following \\p must be '{' or a single-character Unicode property name # [perl #126187
1960\P:A A c - Character following \\P must be '{' or a single-character Unicode property name
1961\p^ A c - Character following \\p must be '{' or a single-character Unicode property name
1962\PU A c - Can't find Unicode property definition \"U\"
361446f1 1963
5b9ce456
KW
1964(?i - c - Sequence (?... not terminated
1965(?a-x - c - Sequence (?... not terminated
d54288eb
KW
1966.{1}?? - c - Nested quantifiers
1967.{1}?+ - c - Nested quantifiers
80edda0d 1968(?:.||)(?|)000000000@ 000000000@ y $& 000000000@ # [perl #126405]
ec5bd226
DC
1969aa$|a(?R)a|a aaa y $& aaa # [perl 128420] recursive matches
1970(?:\1|a)([bcd])\1(?:(?R)|e)\1 abbaccaddedcb y $& abbaccaddedcb # [perl 128420] recursive match with backreferences
71a9d105 1971AB\s+\x{100} AB \x{100}X y - -
2814f4b3 1972\b\z0*\x{100} .\x{100} n - - # [perl #129350] crashed in intuit_start
ac2365fd 1973(.*?(a(a)|i(i))n) riiaan y $2-$3-$4-$1 aa-a--riiaan # Jump trie capture buffer issue [perl #129897]
acfafe8c 1974(^(?:(\d)x)?\d$) 1 y [$1-$2] [1-] # make sure that we reset capture buffers properly (from regtry)
d3c48e81 1975(X{2,}[-X]{1,4}){3,}X{2,} XXX-XXX-XXX-- n - - # [perl #130307]
5b9ce456 1976
77c8f263
KW
1977/[a b]/x \N{SPACE} yS $& # Note a space char here
1978/[a b]/xx \N{SPACE} n - -
1979/[a\ b]/xx \N{SPACE} y $& # Note a space char here
1980/[ ^ a b ]/xx a n - -
1981/[ ^ a b ]/xx b n - -
1982/[ ^ a b ]/xx A y $& A
1983/(?x:[a b])/xx \N{SPACE} yS $& # Note a space char here
1984/(?xx:[a b])/x \N{SPACE} n - -
1985/(?x)[a b]/xx \N{SPACE} yS $& # Note a space char here
1986/(?xx)[a b]/x \N{SPACE} n - -
1987/(?-x:[a b])/xx \N{SPACE} yS $& # Note a space char here
1988
602afc9b
KW
1989# Keep these lines at the end of the file
1990# vim: softtabstop=0 noexpandtab