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