22 ab*bc abbbbc y $& abbbbc
23 ab*bc abbbbc y $-[0] 0
24 ab*bc abbbbc y $+[0] 6
28 .{3,4} abbbbc y $& abbb
29 .{3,4} abbbbc y $-[0] 0
30 .{3,4} abbbbc y $+[0] 4
31 ab{0,}bc abbbbc y $& abbbbc
32 ab{0,}bc abbbbc y $-[0] 0
33 ab{0,}bc abbbbc y $+[0] 6
40 ab+bc abbbbc y $& abbbbc
41 ab+bc abbbbc y $-[0] 0
42 ab+bc abbbbc y $+[0] 6
43 ab{1,}bc abbbbc y $& abbbbc
44 ab{1,}bc abbbbc y $-[0] 0
45 ab{1,}bc abbbbc y $+[0] 6
46 ab{1,3}bc abbbbc y $& abbbbc
47 ab{1,3}bc abbbbc y $-[0] 0
48 ab{1,3}bc abbbbc y $+[0] 6
49 ab{3,4}bc abbbbc y $& abbbbc
50 ab{3,4}bc abbbbc y $-[0] 0
51 ab{3,4}bc abbbbc y $+[0] 6
52 ab{4,5}bc abbbbc n - -
55 ab{0,1}bc abc y $& abc
74 [a][b][d] abd y $& abd
77 (?i:.[b].) abd y $& abd
83 a[b-a] - c - Invalid [] range \"b-a\"
84 a[]b - c - Unmatched [
140 *a - c - Quantifier follows nothing
141 (|*)b - c - Quantifier follows nothing
142 (*)b - c - Unknown verb
144 a\ - c - Search pattern not terminated
145 a\(b a(b y $&-$1 a(b-
149 abc) - c - Unmatched )
150 (abc - c - Unmatched (
151 ((a)) abc y $&-$1-$2 a-a-a
152 ((a)) abc y $-[0]-$-[1]-$-[2] 0-0-0
153 ((a)) abc y $+[0]-$+[1]-$+[2] 1-1-1
156 (a)b(c) abc y $&-$1-$2 abc-a-c
157 (a)b(c) abc y $-[0]-$-[1]-$-[2] 0-0-2
158 (a)b(c) abc y $+[0]-$+[1]-$+[2] 3-1-3
159 a+b+c aabbabc y $& abc
160 a{1,}b{1,}c aabbabc y $& abc
161 a** - c - Nested quantifiers
162 a.+?c abcabc y $& abc
163 (a+|b)* ab y $&-$1 ab-b
168 (a+|b){0,} ab y $&-$1 ab-b
169 (a+|b)+ ab y $&-$1 ab-b
170 (a+|b){1,} ab y $&-$1 ab-b
171 (a+|b)? ab y $&-$1 a-a
172 (a+|b){0,1} ab y $&-$1 a-a
177 ([abc])*d abbbcd y $&-$1 abbbcd-c
178 ([abc])*bcd abcd y $&-$1 abcd-a
180 (a|b|c|d|e)f ef y $&-$1 ef-e
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
185 abcd*efg abcdefg y $& abcdefg
186 ab* xabyabbbz y $& ab
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
194 a([bc]*)c* abc y $&-$1 abc-bc
195 a([bc]*)(c*d) abcd y $&-$1-$2 abcd-bc-d
196 a([bc]*)(c*d) abcd y $-[0] 0
197 a([bc]*)(c*d) abcd y $+[0] 4
198 a([bc]*)(c*d) abcd y $-[1] 1
199 a([bc]*)(c*d) abcd y $+[1] 3
200 a([bc]*)(c*d) abcd y $-[2] 3
201 a([bc]*)(c*d) abcd y $+[2] 4
202 a([bc]+)(c*d) abcd y $&-$1-$2 abcd-bc-d
203 a([bc]*)(c+d) abcd y $&-$1-$2 abcd-b-cd
204 a([bc]*)(c+d) abcd y $-[0] 0
205 a([bc]*)(c+d) abcd y $+[0] 4
206 a([bc]*)(c+d) abcd y $-[1] 1
207 a([bc]*)(c+d) abcd y $+[1] 2
208 a([bc]*)(c+d) abcd y $-[2] 2
209 a([bc]*)(c+d) abcd y $+[2] 4
210 a[bcd]*dcdcde adcdcde y $& adcdcde
211 a[bcd]+dcdcde adcdcde n - -
212 (ab|a)b*c abc y $&-$1 abc-ab
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
217 ((a)(b)c)(d) abcd y $1-$2-$3-$4 abc-a-b-d
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
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-
235 ((((((((((a)))))))))) a y $10 a
236 ((((((((((a)))))))))) a y $-[0] 0
237 ((((((((((a)))))))))) a y $+[0] 1
238 ((((((((((a)))))))))) a y $-[10] 0
239 ((((((((((a)))))))))) a y $+[10] 1
240 ((((((((((a))))))))))\10 aa y $& aa
241 ((((((((((a))))))))))${bang} aa n - -
242 ((((((((((a))))))))))${bang} a! y $& a!
243 (((((((((a))))))))) a y $& a
244 multiple words of text uh-uh n - -
245 multiple words multiple words, yeah y $& multiple words
246 (.*)c(.*) abcde y $&-$1-$2 abcde-ab-de
247 \((.*), (.*)\) (a, b) y ($2, $1) (b, a)
249 abcd abcd y $&-\$&-\\$& abcd-\$&-\\abcd
250 a(bc)d abcd y $1-\$1-\\$1 bc-\$1-\\bc
252 (abc)\1 abcabc y $1 abc
253 ([a-c]*)\1 abcabc y $1 abc
254 \1 - c - Reference to nonexistent group
255 \2 - c - Reference to nonexistent group
258 (a)|\2 - c - Reference to nonexistent group
259 (([a-c])b*?\2)* ababbbcbc y $&-$1-$2 ababb-bb-b
260 (([a-c])b*?\2){3} ababbbcbc y $&-$1-$2 ababbbcbc-cbc-c
261 ((\3|b)\2(a)x)+ aaxabxbaxbbx n - -
262 ((\3|b)\2(a)x)+ aaaxabaxbaaxbbax y $&-$1-$2-$3 bbax-bbax-b-a
263 ((\3|b)\2(a)){2,} bbaababbabaaaaabbaaaabba y $&-$1-$2-$3 bbaaaabba-bba-b-a
274 'abc'i XABCY y $& ABC
275 'abc'i ABABC y $& ABC
277 'ab*bc'i ABC y $& ABC
278 'ab*bc'i ABBC y $& ABBC
279 'ab*?bc'i ABBBBC y $& ABBBBC
280 'ab{0,}?bc'i ABBBBC y $& ABBBBC
281 'ab+?bc'i ABBC y $& ABBC
284 'ab{1,}bc'i ABQ n - -
285 'ab+bc'i ABBBBC y $& ABBBBC
286 'ab{1,}?bc'i ABBBBC y $& ABBBBC
287 'ab{1,3}?bc'i ABBBBC y $& ABBBBC
288 'ab{3,4}?bc'i ABBBBC y $& ABBBBC
289 'ab{4,5}?bc'i ABBBBC n - -
290 'ab??bc'i ABBC y $& ABBC
291 'ab??bc'i ABC y $& ABC
292 'ab{0,1}?bc'i ABC y $& ABC
293 'ab??bc'i ABBBBC n - -
294 'ab??c'i ABC y $& ABC
295 'ab{0,1}?c'i ABC y $& ABC
296 '^abc$'i ABC y $& ABC
298 '^abc'i ABCC y $& ABC
300 'abc$'i AABC y $& ABC
305 'a.*?c'i AXYZC y $& AXYZC
308 'a[bc]d'i ABD y $& ABD
310 'a[b-d]e'i ACE y $& ACE
311 'a[b-d]'i AAC y $& AC
314 'a[b-a]'i - c - Invalid [] range \"b-a\"
315 'a[]b'i - c - Unmatched [
316 'a['i - c - Unmatched [
318 'a[]]b'i A]B y $& A]B
319 'a[^bc]d'i AED y $& AED
321 'a[^-b]c'i ADC y $& ADC
324 'a[^]b]c'i ADC y $& ADC
326 'ab|cd'i ABCD y $& AB
327 '()ef'i DEF y $&-$1 EF-
328 '*a'i - c - Quantifier follows nothing
329 '(|*)b'i - c - Quantifier follows nothing
330 '(*)b'i - c - Unknown verb
332 'a\'i - c - Search pattern not terminated
333 'a\(b'i A(B y $&-$1 A(B-
335 'a\(*b'i A((B y $& A((B
336 'a\\b'i A\\B y $& A\\B
337 'abc)'i - c - Unmatched )
338 '(abc'i - c - Unmatched (
339 '((a))'i ABC y $&-$1-$2 A-A-A
340 '(a)b(c)'i ABC y $&-$1-$2 ABC-A-C
341 'a+b+c'i AABBABC y $& ABC
342 'a{1,}b{1,}c'i AABBABC y $& ABC
343 'a**'i - c - Nested quantifiers
344 'a.+?c'i ABCABC y $& ABC
345 'a.*?c'i ABCABC y $& ABC
346 'a.{0,5}?c'i ABCABC y $& ABC
347 '(a+|b)*'i AB y $&-$1 AB-B
348 '(a+|b){0,}'i AB y $&-$1 AB-B
349 '(a+|b)+'i AB y $&-$1 AB-B
350 '(a+|b){1,}'i AB y $&-$1 AB-B
351 '(a+|b)?'i AB y $&-$1 A-A
352 '(a+|b){0,1}'i AB y $&-$1 A-A
353 '(a+|b){0,1}?'i AB y $&-$1 -
354 ')('i - c - Unmatched )
355 '[^ab]*'i CDE y $& CDE
358 '([abc])*d'i ABBBCD y $&-$1 ABBBCD-C
359 '([abc])*bcd'i ABCD y $&-$1 ABCD-A
360 'a|b|c|d|e'i E y $& E
361 '(a|b|c|d|e)f'i EF y $&-$1 EF-E
362 'abcd*efg'i ABCDEFG y $& ABCDEFG
363 'ab*'i XABYABBBZ y $& AB
364 'ab*'i XAYABBBZ y $& A
365 '(ab|cd)e'i ABCDE y $&-$1 CDE-CD
366 '[abhgefdc]ij'i HIJ y $& HIJ
367 '^(ab|cd)e'i ABCDE n x$1y XY
368 '(abc|)ef'i ABCDEF y $&-$1 EF-
369 '(a|b)c*d'i ABCD y $&-$1 BCD-B
370 '(ab|ab*)bc'i ABC y $&-$1 ABC-A
371 'a([bc]*)c*'i ABC y $&-$1 ABC-BC
372 'a([bc]*)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
373 'a([bc]+)(c*d)'i ABCD y $&-$1-$2 ABCD-BC-D
374 'a([bc]*)(c+d)'i ABCD y $&-$1-$2 ABCD-B-CD
375 'a[bcd]*dcdcde'i ADCDCDE y $& ADCDCDE
376 'a[bcd]+dcdcde'i ADCDCDE n - -
377 '(ab|a)b*c'i ABC y $&-$1 ABC-AB
378 '((a)(b)c)(d)'i ABCD y $1-$2-$3-$4 ABC-A-B-D
379 '[a-zA-Z_][a-zA-Z0-9_]*'i ALPHA y $& ALPHA
380 '^a(bc+|b[eh])g|.h$'i ABH y $&-$1 BH-
381 '(bc+d$|ef*g.|h?i(j|k))'i EFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
382 '(bc+d$|ef*g.|h?i(j|k))'i IJ y $&-$1-$2 IJ-IJ-J
383 '(bc+d$|ef*g.|h?i(j|k))'i EFFG n - -
384 '(bc+d$|ef*g.|h?i(j|k))'i BCDD n - -
385 '(bc+d$|ef*g.|h?i(j|k))'i REFFGZ y $&-$1-$2 EFFGZ-EFFGZ-
386 '((((((((((a))))))))))'i A y $10 A
387 '((((((((((a))))))))))\10'i AA y $& AA
388 '((((((((((a))))))))))${bang}'i AA n - -
389 '((((((((((a))))))))))${bang}'i A! y $& A!
390 '(((((((((a)))))))))'i A y $& A
391 '(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))'i A y $1 A
392 '(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))'i C y $1 C
393 'multiple words of text'i UH-UH n - -
394 'multiple words'i MULTIPLE WORDS, YEAH y $& MULTIPLE WORDS
395 '(.*)c(.*)'i ABCDE y $&-$1-$2 ABCDE-AB-DE
396 '\((.*), (.*)\)'i (A, B) y ($2, $1) (B, A)
398 'abcd'i ABCD y $&-\$&-\\$& ABCD-\$&-\\ABCD
399 'a(bc)d'i ABCD y $1-\$1-\\$1 BC-\$1-\\BC
401 '(abc)\1'i ABCABC y $1 ABC
402 '([a-c]*)\1'i ABCABC y $1 ABC
405 a(?=c|d). abad y $& ad
406 a(?:b|c|d)(.) ace y $1 e
407 a(?:b|c|d)*(.) ace y $1 e
408 a(?:b|c|d)+?(.) ace y $1 e
409 a(?:b|c|d)+?(.) acdbcdbe y $1 d
410 a(?:b|c|d)+(.) acdbcdbe y $1 e
411 a(?:b|c|d){2}(.) acdbcdbe y $1 b
412 a(?:b|c|d){4,5}(.) acdbcdbe y $1 b
413 a(?:b|c|d){4,5}?(.) acdbcdbe y $1 d
414 ((foo)|(bar))* foobar y $1-$2-$3 bar-foo-bar
415 :(?: - c - Sequence (? incomplete
416 a(?:b|c|d){6,7}(.) acdbcdbe y $1 e
417 a(?:b|c|d){6,7}?(.) acdbcdbe y $1 e
418 a(?:b|c|d){5,6}(.) acdbcdbe y $1 e
419 a(?:b|c|d){5,6}?(.) acdbcdbe y $1 b
420 a(?:b|c|d){5,7}(.) acdbcdbe y $1 e
421 a(?:b|c|d){5,7}?(.) acdbcdbe y $1 b
422 a(?:b|(c|e){1,2}?|d)+?(.) ace y $1$2 ce
424 ^([^a-z])|(\^)$ . y $1 .
426 ^(a\1?){4}$ aaaaaaaaaa y $1 aaaa
427 ^(a\1?){4}$ aaaaaaaaa n - -
428 ^(a\1?){4}$ aaaaaaaaaaa n - -
429 ^(a(?(1)\1)){4}$ aaaaaaaaaa y $1 aaaa
430 ^(a(?(1)\1)){4}$ aaaaaaaaa n - -
431 ^(a(?(1)\1)){4}$ aaaaaaaaaaa n - -
432 ((a{4})+) aaaaaaaaa y $1 aaaaaaaa
433 (((aa){2})+) aaaaaaaaaa y $1 aaaaaaaa
434 (((a{2}){2})+) aaaaaaaaaa y $1 aaaaaaaa
435 (?:(f)(o)(o)|(b)(a)(r))* foobar y $1:$2:$3:$4:$5:$6 f:o:o:b:a:r
443 (?<%)b - c - Sequence (?<%...) not recognized
444 (?:..)*a aba y $& aba
446 ^(?:b|a(?=(.)))*\1 abc y $& ab
449 ^((a|b)+)*ax aax y $1 a
450 ^((a|bc)+)*ax aax y $1 a
453 (?:(?i)a)b ab y $& ab
454 ((?i)a)b ab y $&:$1 ab:a
455 (?:(?i)a)b Ab y $& Ab
456 ((?i)a)b Ab y $&:$1 Ab:A
460 ((?i:a))b ab y $&:$1 ab:a
462 ((?i:a))b Ab y $&:$1 Ab:A
465 '(?:(?-i)a)b'i ab y $& ab
466 '((?-i)a)b'i ab y $&:$1 ab:a
467 '(?:(?-i)a)b'i aB y $& aB
468 '((?-i)a)b'i aB y $&:$1 aB:a
469 '(?:(?-i)a)b'i Ab n - -
470 '((?-i)a)b'i Ab n - -
471 '(?:(?-i)a)b'i aB y $& aB
472 '((?-i)a)b'i aB y $1 a
473 '(?:(?-i)a)b'i AB n - -
474 '((?-i)a)b'i 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
480 '((?-i:a))b'i Ab n - -
481 '(?-i:a)b'i aB y $& aB
482 '((?-i:a))b'i aB y $1 a
484 '((?-i:a))b'i AB n - -
485 '((?-i:a.))b'i a\nB n - -
486 '((?s-i:a.))b'i a\nB y $1 a\n
487 '((?s-i:a.))b'i B\nB n - -
488 (?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b))) cabbbb y $& cabbbb
489 (?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb))) caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb y $& caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
490 '(ab)\d\1'i Ab4ab y $1 Ab
491 '(ab)\d\1'i ab4Ab y $1 ab
492 foo\w*\d{4}baz foobar1234baz y $& foobar1234baz
494 a(?{)b - c - Sequence (?{...}) not terminated or not {}-balanced
495 a(?{{})b - c - Sequence (?{...}) not terminated or not {}-balanced
497 a(?{"{"})b - c - Sequence (?{...}) not terminated or not {}-balanced
498 a(?{"\{"})b cabd y $& ab
499 a(?{"{"}})b - c - Unmatched right curly bracket
500 a(?{$bl="\{"}).b caxbd y $bl {
501 x(~~)*(?:(?:F)?)? x~~ y - -
502 ^a(?#xxx){3}c aaac y $& aaac
503 '^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
504 (?<![cd])b dbcb n - -
505 (?<![cd])[ab] dbaacb y $& a
506 (?<!(c|d))b dbcb n - -
507 (?<!(c|d))[ab] dbaacb y $& a
508 (?<!cd)[ab] cdaccb y $& b
509 ^(?:a?b?)*$ a-- n - -
510 ((?s)^a(.))((?m)^b$) a\nb\nc\n y $1;$2;$3 a\n;\n;b
511 ((?m)^b$) a\nb\nc\n y $1 b
513 (?m)^(b) a\nb\n y $1 b
514 ((?m)^b) a\nb\n y $1 b
515 \n((?m)^b) a\nb\n y $1 b
516 ((?s).)c(?!.) a\nb\nc\n y $1 \n
517 ((?s).)c(?!.) a\nb\nc\n y $1:$& \n:\nc
518 ((?s)b.)c(?!.) a\nb\nc\n y $1 b\n
519 ((?s)b.)c(?!.) a\nb\nc\n y $1:$& b\n:b\nc
522 ((?m)^b) a\nb\nc\n y $1 b
525 (x)?(?(1)a|b) a n - -
526 (x)?(?(1)b|a) a y $& a
527 ()?(?(1)b|a) a y $& a
529 ()?(?(1)a|b) a y $& a
530 ^(\()?blah(?(1)(\)))$ (blah) y $2 )
531 ^(\()?blah(?(1)(\)))$ blah y ($2) ()
532 ^(\()?blah(?(1)(\)))$ blah) n - -
533 ^(\()?blah(?(1)(\)))$ (blah n - -
534 ^(\(+)?blah(?(1)(\)))$ (blah) y $2 )
535 ^(\(+)?blah(?(1)(\)))$ blah y ($2) ()
536 ^(\(+)?blah(?(1)(\)))$ blah) n - -
537 ^(\(+)?blah(?(1)(\)))$ (blah n - -
538 (?(1?)a|b) a c - Switch condition not recognized
539 (?(1)a|b|c) a c - Switch (?(condition)... contains too many branches
541 (?(?{0})b|a) a y $& a
543 (?(?{1})a|b) a y $& a
548 (?=(a+?))(\1ab) aaab y $2 aab
549 ^(?=(a+?))\1ab aaab n - -
550 (\w+:)+ one: y $1 one:
552 (?=(a+?))(\1ab) aaab y $2 aab
553 ^(?=(a+?))\1ab aaab n - -
554 ([\w:]+::)?(\w+)$ abcd: n - -
555 ([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
556 ([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
557 ^[^bcd]*(c+) aexycd y $1 c
559 ([\w:]+::)?(\w+)$ abcd: n - -
560 ([\w:]+::)?(\w+)$ abcd y $1-$2 -abcd
561 ([\w:]+::)?(\w+)$ xy:z:::abcd y $1-$2 xy:z:::-abcd
562 ^[^bcd]*(c+) aexycd y $1 c
563 (?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a}) yaaxxaaaacd y $b 3
564 (?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a}) yaaxxaaaacd y $b 4
567 ([[:]+) a:[b]: y $1 :[
568 ([[=]+) a=[b]= y $1 =[
569 ([[.]+) a.[b]. y $1 .[
570 [a[:xyz: - c - Unmatched [
571 [a[:xyz:] - c - POSIX class [:xyz:] unknown
572 [a[:]b[:c] abc y $& abc
573 ([a[:xyz:]b]+) pbaq c - POSIX class [:xyz:] unknown
574 [a[:]b[:c] abc y $& abc
575 ([[:alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
576 ([[:alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
577 ([[:ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__-- ${nulnul}
578 ([[:cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}
579 ([[:digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
580 ([[:graph:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
581 ([[:lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd
582 ([[:print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
583 ([[:punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __--
584 ([[:space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1
585 ([[:word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__
586 ([[:upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
587 ([[:xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01
588 ([[:^alpha:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 01
589 ([[:^alnum:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 __-- ${nulnul}${ffff}
590 ([[:^ascii:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${ffff}
591 ([[:^cntrl:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
592 ([[:^digit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd
593 ([[:^lower:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 AB
594 ([[:^print:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ${nulnul}${ffff}
595 ([[:^punct:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy
596 ([[:^space:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 ABcd01Xy__--
597 ([[:^word:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 -- ${nulnul}${ffff}
598 ([[:^upper:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 cd01
599 ([[:^xdigit:]]+) ABcd01Xy__-- ${nulnul}${ffff} y $1 Xy__-- ${nulnul}${ffff}
600 [[:foo:]] - c - POSIX class [:foo:] unknown
601 [[:^foo:]] - c - POSIX class [:^foo:] unknown
602 ((?>a+)b) aaab y $1 aaab
603 (?>(a+))b aaab y $1 aaa
604 ((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
605 (?<=x+)y - c - Variable length lookbehind not implemented
606 a{37,17} - c - Can't do {n,m} with n > m
616 '\Z'm a\nb\n y $-[0] 3
617 '\z'm a\nb\n y $-[0] 4
618 '$'m a\nb\n y $-[0] 1
619 '\Z'm b\na\n y $-[0] 3
620 '\z'm b\na\n y $-[0] 4
621 '$'m b\na\n y $-[0] 1
636 'a$'m a\nb\n y $-[0] 0
637 'a\Z'm b\na\n y $-[0] 2
639 'a$'m b\na\n y $-[0] 2
640 'a\Z'm b\na y $-[0] 2
641 'a\z'm b\na y $-[0] 2
646 aa\Z b\naa\n y $-[0] 2
648 aa$ b\naa\n y $-[0] 2
652 'aa\Z'm aa\nb\n n - -
653 'aa\z'm aa\nb\n n - -
654 'aa$'m aa\nb\n y $-[0] 0
655 'aa\Z'm b\naa\n y $-[0] 2
656 'aa\z'm b\naa\n n - -
657 'aa$'m b\naa\n y $-[0] 2
658 'aa\Z'm b\naa y $-[0] 2
659 'aa\z'm b\naa y $-[0] 2
660 'aa$'m b\naa y $-[0] 2
670 'aa\Z'm ac\nb\n n - -
671 'aa\z'm ac\nb\n n - -
673 'aa\Z'm b\nac\n n - -
674 'aa\z'm b\nac\n n - -
688 'aa\Z'm ca\nb\n n - -
689 'aa\z'm ca\nb\n n - -
691 'aa\Z'm b\nca\n n - -
692 'aa\z'm b\nca\n n - -
700 ab\Z b\nab\n y $-[0] 2
702 ab$ b\nab\n y $-[0] 2
706 'ab\Z'm ab\nb\n n - -
707 'ab\z'm ab\nb\n n - -
708 'ab$'m ab\nb\n y $-[0] 0
709 'ab\Z'm b\nab\n y $-[0] 2
710 'ab\z'm b\nab\n n - -
711 'ab$'m b\nab\n y $-[0] 2
712 'ab\Z'm b\nab y $-[0] 2
713 'ab\z'm b\nab y $-[0] 2
714 'ab$'m b\nab y $-[0] 2
724 'ab\Z'm ac\nb\n n - -
725 'ab\z'm ac\nb\n n - -
727 'ab\Z'm b\nac\n n - -
728 'ab\z'm b\nac\n n - -
742 'ab\Z'm ca\nb\n n - -
743 'ab\z'm ca\nb\n n - -
745 'ab\Z'm b\nca\n n - -
746 'ab\z'm b\nca\n n - -
754 abb\Z b\nabb\n y $-[0] 2
756 abb$ b\nabb\n y $-[0] 2
757 abb\Z b\nabb y $-[0] 2
758 abb\z b\nabb y $-[0] 2
759 abb$ b\nabb y $-[0] 2
760 'abb\Z'm abb\nb\n n - -
761 'abb\z'm abb\nb\n n - -
762 'abb$'m abb\nb\n y $-[0] 0
763 'abb\Z'm b\nabb\n y $-[0] 2
764 'abb\z'm b\nabb\n n - -
765 'abb$'m b\nabb\n y $-[0] 2
766 'abb\Z'm b\nabb y $-[0] 2
767 'abb\z'm b\nabb y $-[0] 2
768 'abb$'m b\nabb y $-[0] 2
778 'abb\Z'm ac\nb\n n - -
779 'abb\z'm ac\nb\n n - -
780 'abb$'m ac\nb\n n - -
781 'abb\Z'm b\nac\n n - -
782 'abb\z'm b\nac\n n - -
783 'abb$'m b\nac\n n - -
796 'abb\Z'm ca\nb\n n - -
797 'abb\z'm ca\nb\n n - -
798 'abb$'m ca\nb\n n - -
799 'abb\Z'm b\nca\n n - -
800 'abb\z'm b\nca\n n - -
801 'abb$'m b\nca\n n - -
806 a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz x n - -
807 a(?{$a=2;$b=3;($b)=$a})b yabz y $b 2
808 round\(((?>[^()]+))\) _I(round(xs * sz),1) y $1 xs * sz
809 '((?x:.) )' x y $1- x -
810 '((?-x:.) )'x x y $1- x-
811 foo.bart foo.bart y - -
812 '^d[x][x][x]'m abcd\ndxxx y - -
813 .X(.+)+X bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
814 .X(.+)+XX bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
815 .XX(.+)+X bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
816 .X(.+)+X bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
817 .X(.+)+XX bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
818 .XX(.+)+X bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
819 .X(.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
820 .X(.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
821 .XX(.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
822 .X(.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
823 .X(.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
824 .XX(.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
825 .[X](.+)+[X] bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
826 .[X](.+)+[X][X] bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
827 .[X][X](.+)+[X] bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y - -
828 .[X](.+)+[X] bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
829 .[X](.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
830 .[X][X](.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - -
832 ([a-\d]+) za-9z y $1 a-9
833 ([\d-z]+) a0-za y $1 0-z
834 ([\d-\s]+) a0- z y $1 0-
835 ([a-[:digit:]]+) za-9z y $1 a-9
836 ([[:digit:]-z]+) =0-z= y $1 0-z
837 ([[:digit:]-[:alpha:]]+) =0-z= y $1 0-z
839 (\d+\.\d+) 3.1415926 y $1 3.1415926
840 (\ba.{0,10}br) have a web browser y $1 a web br
841 '\.c(pp|xx|c)?$'i Changes n - -
842 '\.c(pp|xx|c)?$'i IO.c y - -
843 '(\.c(pp|xx|c)?$)'i IO.c y $1 .c
845 '^\S\s+aa$'m \nx aa y - -
847 ^([ab]*?)(b)?(c)$ abac y -$2- --
848 (\w)?(abc)\1b abcab n - -
849 ^(?:.,){2}c a,b,c y - -
850 ^(.,){2}c a,b,c y $1 b,
851 ^(?:[^,]*,){2}c a,b,c y - -
852 ^([^,]*,){2}c a,b,c y $1 b,
853 ^([^,]*,){3}d aaa,b,c,d y $1 c,
854 ^([^,]*,){3,}d aaa,b,c,d y $1 c,
855 ^([^,]*,){0,3}d aaa,b,c,d y $1 c,
856 ^([^,]{1,3},){3}d aaa,b,c,d y $1 c,
857 ^([^,]{1,3},){3,}d aaa,b,c,d y $1 c,
858 ^([^,]{1,3},){0,3}d aaa,b,c,d y $1 c,
859 ^([^,]{1,},){3}d aaa,b,c,d y $1 c,
860 ^([^,]{1,},){3,}d aaa,b,c,d y $1 c,
861 ^([^,]{1,},){0,3}d aaa,b,c,d y $1 c,
862 ^([^,]{0,3},){3}d aaa,b,c,d y $1 c,
863 ^([^,]{0,3},){3,}d aaa,b,c,d y $1 c,
864 ^([^,]{0,3},){0,3}d aaa,b,c,d y $1 c,
866 '(?!\A)x'm a\nxb\n y - -
867 ^(a(b)?)+$ aba y -$1-$2- -a--
868 ^(aa(bb)?)+$ aabbaa y -$1-$2- -aa--
869 '^.{9}abc.*\n'm 123\nabcabcabcabc\n y - -
871 ^(a)?(?(1)a|b)+$ a n - -
872 ^(a\1?)(a\1?)(a\2?)(a\3?)$ aaaaaa y $1,$2,$3,$4 a,aa,a,aa
873 ^(a\1?){4}$ aaaaaa y $1 aa
874 ^(0+)?(?:x(1))? x1 y - -
875 ^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))? 012cxx0190 y - -
876 ^(b+?|a){1,2}c bbbac y $1 a
877 ^(b+?|a){1,2}c bbbbac y $1 a
878 \((\w\. \w+)\) cd. (A. Tw) y -$1- -A. Tw-
879 ((?:aaaa|bbbb)cccc)? aaaacccc y - -
880 ((?:aaaa|bbbb)cccc)? bbbbcccc y - -
881 (a)?(a)+ a y $1:$2 :a -
882 (ab)?(ab)+ ab y $1:$2 :ab -
883 (abc)?(abc)+ abc y $1:$2 :abc -
886 ^(a(??{"(?!)"})|(a)(?{1}))b ab y $2 a # [ID 20010811.006]
887 ab(?i)cd AbCd n - - # [ID 20010809.023]
889 (A|B)*(?(1)(CD)|(CD)) CD y $2-$3 -CD
890 (A|B)*(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
891 (A|B)*?(?(1)(CD)|(CD)) CD y $2-$3 -CD # [ID 20010803.016]
892 (A|B)*?(?(1)(CD)|(CD)) ABCD y $2-$3 CD-
893 '^(o)(?!.*\1)'i Oo n - -
894 (.*)\d+\1 abc12bc y $1 bc
895 (?m:(foo\s*$)) foo\n bar y $1 foo
897 (.*)(?=c) abcd y $1 ab
898 (.*)(?=c)c abcd yB $1 ab
899 (.*)(?=b|c) abcd y $1 ab
900 (.*)(?=b|c)c abcd y $1 ab
901 (.*)(?=c|b) abcd y $1 ab
902 (.*)(?=c|b)c abcd y $1 ab
903 (.*)(?=[bc]) abcd y $1 ab
904 (.*)(?=[bc])c abcd yB $1 ab
905 (.*)(?<=b) abcd y $1 ab
906 (.*)(?<=b)c abcd y $1 ab
907 (.*)(?<=b|c) abcd y $1 abc
908 (.*)(?<=b|c)c abcd y $1 ab
909 (.*)(?<=c|b) abcd y $1 abc
910 (.*)(?<=c|b)c abcd y $1 ab
911 (.*)(?<=[bc]) abcd y $1 abc
912 (.*)(?<=[bc])c abcd y $1 ab
914 (.*?)(?=c) abcd y $1 ab
915 (.*?)(?=c)c abcd yB $1 ab
916 (.*?)(?=b|c) abcd y $1 a
917 (.*?)(?=b|c)c abcd y $1 ab
918 (.*?)(?=c|b) abcd y $1 a
919 (.*?)(?=c|b)c abcd y $1 ab
920 (.*?)(?=[bc]) abcd y $1 a
921 (.*?)(?=[bc])c abcd yB $1 ab
922 (.*?)(?<=b) abcd y $1 ab
923 (.*?)(?<=b)c abcd y $1 ab
924 (.*?)(?<=b|c) abcd y $1 ab
925 (.*?)(?<=b|c)c abcd y $1 ab
926 (.*?)(?<=c|b) abcd y $1 ab
927 (.*?)(?<=c|b)c abcd y $1 ab
928 (.*?)(?<=[bc]) abcd y $1 ab
929 (.*?)(?<=[bc])c abcd y $1 ab
932 a(b)?? abc y <$1> <> # undef [perl #16773]
933 (\d{1,3}\.){3,} 128.134.142.8 y <$1> <142.> # [perl #18019]
934 ^.{3,4}(.+)\1\z foobarbar y $1 bar # 16 tests for [perl #23171]
935 ^(?:f|o|b){3,4}(.+)\1\z foobarbar y $1 bar
936 ^.{3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
937 ^(?:f|o|b){3,4}((?:b|a|r)+)\1\z foobarbar y $1 bar
938 ^.{3,4}(.+?)\1\z foobarbar y $1 bar
939 ^(?:f|o|b){3,4}(.+?)\1\z foobarbar y $1 bar
940 ^.{3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
941 ^(?:f|o|b){3,4}((?:b|a|r)+?)\1\z foobarbar y $1 bar
942 ^.{2,3}?(.+)\1\z foobarbar y $1 bar
943 ^(?:f|o|b){2,3}?(.+)\1\z foobarbar y $1 bar
944 ^.{2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
945 ^(?:f|o|b){2,3}?((?:b|a|r)+)\1\z foobarbar y $1 bar
946 ^.{2,3}?(.+?)\1\z foobarbar y $1 bar
947 ^(?:f|o|b){2,3}?(.+?)\1\z foobarbar y $1 bar
948 ^.{2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
949 ^(?:f|o|b){2,3}?((?:b|a|r)+?)\1\z foobarbar y $1 bar
950 .*a(?!(b|cd)*e).*f ......abef n - - # [perl #23030]
951 x(?# x c - Sequence (?#... not terminated
952 :x(?#: x c - Sequence (?#... not terminated
953 (WORDS|WORD)S WORDS y $1 WORD
954 (X.|WORDS|X.|WORD)S WORDS y $1 WORD
955 (WORDS|WORLD|WORD)S WORDS y $1 WORD
956 (X.|WORDS|WORD|Y.)S WORDS y $1 WORD
957 (foo|fool|x.|money|parted)$ fool y $1 fool
958 (x.|foo|fool|x.|money|parted|y.)$ fool y $1 fool
959 (foo|fool|money|parted)$ fool y $1 fool
960 (foo|fool|x.|money|parted)$ fools n - -
961 (x.|foo|fool|x.|money|parted|y.)$ fools n - -
962 (foo|fool|money|parted)$ fools n - -
963 (a|aa|aaa||aaaa|aaaaa|aaaaaa)(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
964 (a|aa|aaa||aaaa|aaaaa|aaaaaa)(??{$1&&""})(b|c) aaaaaaaaaaaaaaab y $1$2 aaaaaab
965 (a|aa|aaa|aaaa|aaaaa|aaaaaa)(??{$1&&"foo"})(b|c) aaaaaaaaaaaaaaab n - -
966 ^(a*?)(?!(aa|aaaa)*$) aaaaaaaaaaaaaaaaaaaa y $1 a # [perl #34195]
967 ^(a*?)(?!(aa|aaaa)*$)(?=a\z) aaaaaaaa y $1 aaaaaaa
968 ^(.)\s+.$(?(1)) A B y $1 A # [perl #37688]
969 (?:r?)*?r|(.{2,4}) abcde y $1 abcd
970 (?!)+?|(.{2,4}) abcde y $1 abcd
971 ^(a*?)(?!(a{6}|a{5})*$) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa y $+[1] 12 # super-linear cache bug may return 18
972 ^((?>(?:aa)?b)?) aab y $1 aab
973 ^((?:aa)*)(?:X+((?:\d+|-)(?:X+(.+))?))?$ aaaaX5 y $1 aaaa
974 X(A|B||C|D)Y XXXYYY y $& XY # Trie w/ NOTHING
975 (?i:X([A]|[B]|y[Y]y|[D]|)Y) XXXYYYB y $& XY # Trie w/ NOTHING
976 ^([a]{1})*$ aa y $1 a
977 a(?!b(?!c))(..) abababc y $1 bc # test nested negatives
978 a(?!b(?=a))(..) abababc y $1 bc # test nested lookaheads
979 a(?!b(?!c(?!d(?!e))))...(.) abxabcdxabcde y $1 e
980 X(?!b+(?!(c+)*(?!(c+)*d))).*X aXbbbbbbbcccccccccccccaaaX y - -
981 ^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
982 ^(XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
983 ^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
984 ^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
985 ^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
986 ^([TUV]+|XXXXXXXXXX|YYYYYYYYYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
987 ^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
988 ^(XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
989 ^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
990 ^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P): ZEQQQX: y $1 ZEQQQX
991 ^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQQQQQQQQQQQQQQQQP: y $1 ZEQQQQQQQQQQQQQQQQQQP
992 ^([TUV]+|XXX|YYY|Z.Q*X|Z[TE]Q*P|[MKJ]): ZEQQQX: y $1 ZEQQQX
993 X(?:ABCF[cC]x*|ABCD|ABCF):(?:DIT|DID|DIM) XABCFCxxxxxxxxxx:DIM y $& XABCFCxxxxxxxxxx:DIM
994 (((ABCD|ABCE|ABCF)))(A|B|C[xy]*): ABCFCxxxxxxxxxx:DIM y $& ABCFCxxxxxxxxxx:
996 (?=foo) XfooY y pos 1
997 .*(?=foo) XfooY y pos 1
999 (?<=foo) XfooY y pos 4
1000 .*(?<=foo) foo y pos 3
1001 .*(?<=foo) XfooY y pos 4
1002 (?<=foo)Y XfooY y pos 5
1003 o(?<=foo)Y ..XfooY.. y pos 7
1004 X(?=foo)f ..XfooY.. y pos 4
1005 X(?=foo) ..XfooY.. y pos 3
1006 X(?<=foo.)[YZ] ..XfooXY.. y pos 8
1007 (?=XY*foo) Xfoo y pos 0
1008 ^(?=XY*foo) Xfoo y pos 0
1009 ^(??{"a+"})a aa y $& aa
1010 ^(?:(??{"a+"})|b)a aa y $& aa
1011 ^(??{chr 0x100}).$ \x{100}\x{100} y $& \x{100}\x{100}
1012 ^(??{q(\x{100})}). \x{100}\x{100} y $& \x{100}\x{100}
1013 ^(??{q(.+)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1014 ^(??{q(.)})\x{100} \x{100}\x{100} y $& \x{100}\x{100}
1015 ^(??{chr 0x100})\xbb \x{100}\x{bb} y $& \x{100}\x{bb}
1016 ^(.)(??{"(.)(.)"})(.)$ abcd y $1-$2 a-d
1017 ^(.)(??{"(bz+|.)(.)"})(.)$ abcd y $1-$2 a-d
1018 ^(.)((??{"(.)(cz+)"})|.) abcd y $1-$2 a-b
1019 ^a(?>(??{q(b)}))(??{q(c)})d abcd y - -
1020 ^x(??{""})+$ x y $& x
1021 ^(<(?:[^<>]+|(?3)|(?1))*>)()(!>!>!>)$ <<!>!>!>><>>!>!>!> y $1 <<!>!>!>><>>
1022 ^(<(?:[^<>]+|(?1))*>)$ <<><<<><>>>> y $1 <<><<<><>>>>
1023 ((?2)*)([fF]o+) fooFoFoo y $1-$2 fooFo-Foo
1024 (<(?:[^<>]+|(?R))*>) <<><<<><>>>> y $1 <<><<<><>>>>
1025 (?<n>foo|bar|baz) snofooewa y $1 foo
1026 (?<n>foo|bar|baz) snofooewa y $+{n} foo
1027 (?<n>foo|bar|baz)(?<m>[ew]+) snofooewa y $+{n} foo
1028 (?<n>foo|bar|baz)(?<m>[ew]+) snofooewa y $+{m} ew
1029 (?<n>foo)|(?<n>bar)|(?<n>baz) snofooewa y $+{n} foo
1030 (?<n>foo)(??{ $+{n} }) snofooefoofoowaa y $+{n} foo
1031 /(?'n'foo|bar|baz)/ snofooewa y $1 foo
1032 /(?'n'foo|bar|baz)/ snofooewa y $+{n} foo
1033 /(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa y $+{n} foo
1034 /(?'n'foo|bar|baz)(?'m'[ew]+)/ snofooewa y $+{m} ew
1035 /(?'n'foo)|(?'n'bar)|(?<n>baz)/ snobazewa y $+{n} baz
1036 /(?'n'foo)(??{ $+{n} })/ snofooefoofoowaa y $+{n} foo
1037 /(?'n'foo)\k<n>/ ..foofoo.. y $1 foo
1038 /(?'n'foo)\k<n>/ ..foofoo.. y $+{n} foo
1039 /(?<n>foo)\k'n'/ ..foofoo.. y $1 foo
1040 /(?<n>foo)\k'n'/ ..foofoo.. y $+{n} foo
1041 /(?:(?<n>foo)|(?<n>bar))\k<n>/ ..barbar.. y $+{n} bar
1042 /^(?'main'<(?:[^<>]+|(?&crap)|(?&main))*>)(?'empty')(?'crap'!>!>!>)$/ <<!>!>!>><>>!>!>!> y $+{main} <<!>!>!>><>>
1043 /^(?'main'<(?:[^<>]+|(?&main))*>)$/ <<><<<><>>>> y $1 <<><<<><>>>>
1044 /(?'first'(?&second)*)(?'second'[fF]o+)/ fooFoFoo y $+{first}-$+{second} fooFo-Foo
1045 (?<A>foo)?(?(<A>)bar|nada) foobar y $+{A} foo
1046 (?<A>foo)?(?(<A>)bar|nada) foo-barnada y $& nada
1047 (?<A>foo)?(?(1)bar|nada) foo-barnada y $& nada
1048 (?<A>foo(?(R)bar))?(?1) foofoobar y $1 foo
1049 (?<A>foo(?(R)bar))?(?1) foofoobar y $& foofoobar
1050 (x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $2 foo
1051 (x)(?<A>foo(?(R&A)bar))?(?&A) xfoofoobar y $& xfoofoobar
1052 (x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $2 foo
1053 (x)(?<A>foo(?(R2)bar))?(?&A) xfoofoobar y $& xfoofoobar
1054 (?1)(?(DEFINE)(blah)) blah y $& blah
1055 /^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamimadam y $& madamimadam
1056 /^(?<PAL>(?<CHAR>.)((?&PAL)|.?)\k<CHAR>)$/ madamiamadam n - -
1057 /(a)?((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1058 /(a)*((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1059 /(a)+((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1060 /(a){1,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1061 /(a){0,100}((?1))(fox)/ aafox y $1-$2-$3 a-a-fox
1062 /(ab)?((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1063 /(ab)*((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1064 /(ab)+((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1065 /(ab){1,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1066 /(ab){0,100}((?1))(fox)/ ababfox y $1-$2-$3 ab-ab-fox
1067 # possessive captures
1070 a{1,5}+a aaaaa n - -
1072 a++b aaaaab y $& aaaaab
1073 a*+b aaaaab y $& aaaaab
1074 a{1,5}+b aaaaab y $& aaaaab
1076 fooa++a fooaaaaa n - -
1077 fooa*+a fooaaaaa n - -
1078 fooa{1,5}+a fooaaaaa n - -
1080 fooa++b fooaaaaab y $& fooaaaaab
1081 fooa*+b fooaaaaab y $& fooaaaaab
1082 fooa{1,5}+b fooaaaaab y $& fooaaaaab
1083 fooa?+b fooab y $& fooab
1084 (?:aA)++(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1085 (aA)++(aA) aAaAaAaAaA n - aAaAaAaAaA
1086 (aA|bB)++(aA|bB) aAaAbBaAbB n - aAaAbBaAbB
1087 (?:aA|bB)++(?:aA|bB) aAbBbBbBaA n - aAbBbBbBaA
1088 (?:aA)*+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1089 (aA)*+(aA) aAaAaAaAaA n - aAaAaAaAaA
1090 (aA|bB)*+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1091 (?:aA|bB)*+(?:aA|bB) aAaAaAbBaA n - aAaAaAbBaA
1092 (?:aA){1,5}+(?:aA) aAaAaAaAaA n - aAaAaAaAaA
1093 (aA){1,5}+(aA) aAaAaAaAaA n - aAaAaAaAaA
1094 (aA|bB){1,5}+(aA|bB) aAaAbBaAaA n - aAaAbBaAaA
1095 (?:aA|bB){1,5}+(?:aA|bB) bBbBbBbBbB n - bBbBbBbBbB
1096 (?:aA)?+(?:aA) aAb n - aAb
1097 (aA)?+(aA) aAb n - aAb
1098 (aA|bB)?+(aA|bB) bBb n - bBb
1099 (?:aA|bB)?+(?:aA|bB) aAb n - aAb
1100 (?:aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1101 (aA)++b aAaAaAaAaAb y $& aAaAaAaAaAb
1102 (aA|bB)++b aAbBaAaAbBb y $& aAbBaAaAbBb
1103 (?:aA|bB)++b aAbBbBaAaAb y $& aAbBbBaAaAb
1104 (?:aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1105 (aA)*+b aAaAaAaAaAb y $& aAaAaAaAaAb
1106 (aA|bB)*+b bBbBbBbBbBb y $& bBbBbBbBbBb
1107 (?:aA|bB)*+b bBaAbBbBaAb y $& bBaAbBbBaAb
1108 (?:aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1109 (aA){1,5}+b aAaAaAaAaAb y $& aAaAaAaAaAb
1110 (aA|bB){1,5}+b bBaAbBaAbBb y $& bBaAbBaAbBb
1111 (?:aA|bB){1,5}+b aAbBaAbBbBb y $& aAbBaAbBbBb
1112 (?:aA)?+b aAb y $& aAb
1113 (aA)?+b aAb y $& aAb
1114 (aA|bB)?+b bBb y $& bBb
1115 (?:aA|bB)?+b bBb y $& bBb
1116 foo(?:aA)++(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1117 foo(aA)++(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1118 foo(aA|bB)++(aA|bB) foobBbBbBaAaA n - foobBbBbBaAaA
1119 foo(?:aA|bB)++(?:aA|bB) fooaAaAaAaAaA n - fooaAaAaAaAaA
1120 foo(?:aA)*+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1121 foo(aA)*+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1122 foo(aA|bB)*+(aA|bB) foobBaAbBaAaA n - foobBaAbBaAaA
1123 foo(?:aA|bB)*+(?:aA|bB) fooaAaAbBbBaA n - fooaAaAbBbBaA
1124 foo(?:aA){1,5}+(?:aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1125 foo(aA){1,5}+(aA) fooaAaAaAaAaA n - fooaAaAaAaAaA
1126 foo(aA|bB){1,5}+(aA|bB) fooaAbBbBaAaA n - fooaAbBbBaAaA
1127 foo(?:aA|bB){1,5}+(?:aA|bB) fooaAbBbBaAbB n - fooaAbBbBaAbB
1128 foo(?:aA)?+(?:aA) fooaAb n - fooaAb
1129 foo(aA)?+(aA) fooaAb n - fooaAb
1130 foo(aA|bB)?+(aA|bB) foobBb n - foobBb
1131 foo(?:aA|bB)?+(?:aA|bB) fooaAb n - fooaAb
1132 foo(?:aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1133 foo(aA)++b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1134 foo(aA|bB)++b foobBaAbBaAbBb y $& foobBaAbBaAbBb
1135 foo(?:aA|bB)++b fooaAaAbBaAaAb y $& fooaAaAbBaAaAb
1136 foo(?:aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1137 foo(aA)*+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1138 foo(aA|bB)*+b foobBbBaAaAaAb y $& foobBbBaAaAaAb
1139 foo(?:aA|bB)*+b foobBaAaAbBaAb y $& foobBaAaAbBaAb
1140 foo(?:aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1141 foo(aA){1,5}+b fooaAaAaAaAaAb y $& fooaAaAaAaAaAb
1142 foo(aA|bB){1,5}+b foobBaAaAaAaAb y $& foobBaAaAaAaAb
1143 foo(?:aA|bB){1,5}+b fooaAbBaAbBbBb y $& fooaAbBaAbBbBb
1144 foo(?:aA)?+b fooaAb y $& fooaAb
1145 foo(aA)?+b fooaAb y $& fooaAb
1146 foo(aA|bB)?+b foobBb y $& foobBb
1147 foo(?:aA|bB)?+b foobBb y $& foobBb
1149 ([^()]++|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x
1150 round\(([^()]++)\) _I(round(xs * sz),1) y $1 xs * sz
1152 (foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $1 baz3
1153 (foo[1x]|bar[2x]|baz[3x])+y foo1bar2baz3y y $& foo1bar2baz3y
1154 (foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $1 baz3
1155 (foo[1x]|bar[2x]|baz[3x])*y foo1bar2baz3y y $& foo1bar2baz3y
1157 ([yX].|WORDS|[yX].|WORD)S WORDS y $1 WORD
1158 (WORDS|WORLD|WORD)S WORDS y $1 WORD
1159 ([yX].|WORDS|WORD|[xY].)S WORDS y $1 WORD
1160 (foo|fool|[zx].|money|parted)$ fool y $1 fool
1161 ([zx].|foo|fool|[zq].|money|parted|[yx].)$ fool y $1 fool
1162 (foo|fool|[zx].|money|parted)$ fools n - -
1163 ([zx].|foo|fool|[qx].|money|parted|[py].)$ fools n - -
1165 ([yX].|WORDS|[yX].|WORD)+S WORDS y $1 WORD
1166 (WORDS|WORLD|WORD)+S WORDS y $1 WORD
1167 ([yX].|WORDS|WORD|[xY].)+S WORDS y $1 WORD
1168 (foo|fool|[zx].|money|parted)+$ fool y $1 fool
1169 ([zx].|foo|fool|[zq].|money|parted|[yx].)+$ fool y $1 fool
1170 (foo|fool|[zx].|money|parted)+$ fools n - -
1171 ([zx].|foo|fool|[qx].|money|parted|[py].)+$ fools n - -
1173 (x|y|z[QW])+(longish|loquatious|excessive|overblown[QW])+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1174 (x|y|z[QW])*(longish|loquatious|excessive|overblown[QW])* xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1175 (x|y|z[QW]){1,5}(longish|loquatious|excessive|overblown[QW]){1,5} xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1177 (x|y|z[QW])++(longish|loquatious|excessive|overblown[QW])++ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1178 (x|y|z[QW])*+(longish|loquatious|excessive|overblown[QW])*+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1179 (x|y|z[QW]){1,5}+(longish|loquatious|excessive|overblown[QW]){1,5}+ xyzQzWlongishoverblownW y $1-$2 zW-overblownW
1183 a*(*FAIL) aaaab n - -
1186 (A(A|B(*ACCEPT)|C)D)(E) AB y $1 AB
1187 (A(A|B(*ACCEPT)|C)D)(E) ACDE y $1$2$3 ACDCE
1189 (a)(?:(?-1)|(?+1))(b) aab y $&-$1-$2 aab-a-b
1190 (a)(?:(?-1)|(?+1))(b) abb y $1-$2 a-b
1191 (a)(?:(?-1)|(?+1))(b) acb n - -
1193 (foo)(\g-2) foofoo y $1-$2 foo-foo
1194 (foo)(\g-2)(foo)(\g-2) foofoofoofoo y $1-$2-$3-$4 foo-foo-foo-foo
1195 (([abc]+) \g-1)(([abc]+) \g{-1}) abc abccba cba y $2-$4 abc-cba
1196 (a)(b)(c)\g1\g2\g3 abcabc y $1$2$3 abc
1199 /(?'n'foo) \k<n>/ ..foo foo.. y $1 foo
1200 /(?'n'foo) \k<n>/ ..foo foo.. y $+{n} foo
1201 /(?<n>foo) \k'n'/ ..foo foo.. y $1 foo
1202 /(?<n>foo) \k'n'/ ..foo foo.. y $+{n} foo
1203 /(?<as>as) (\w+) \k<as> (\w+)/ as easy as pie y $1-$2-$3 as-easy-pie