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