/[pcre]/code/trunk/testdata/testinput2
ViewVC logotype

Contents of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1542 - (hide annotations) (download)
Wed Apr 1 15:43:53 2015 UTC (16 hours, 20 minutes ago) by ph10
File size: 66602 byte(s)
Fix stack overflow instead of diagnostic for mutual recursion inside a 
lookbehind assertion.

1 ph10 450 /-- This set of tests is not Perl-compatible. It checks on special features
2     of PCRE's API, error diagnostics, and the compiled code of some patterns.
3     It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4     Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5 ph10 513 either because PCRE can't be compatible, or there is a possible Perl
6 ph10 836 bug.
7    
8     NOTE: This is a non-UTF set of tests. When UTF support is needed, use
9     test 5, and if Unicode Property Support is needed, use test 7. --/
10 ph10 1388
11     < forbid 8W
12 ph10 450
13 nigel 93 /(a)b|/I
14 nigel 41
15 nigel 93 /abc/I
16 nigel 41 abc
17     defabc
18     \Aabc
19     *** Failers
20     \Adefabc
21     ABC
22    
23 nigel 93 /^abc/I
24 nigel 41 abc
25     \Aabc
26     *** Failers
27     defabc
28     \Adefabc
29    
30 nigel 93 /a+bc/I
31 nigel 41
32 nigel 93 /a*bc/I
33 nigel 41
34 nigel 93 /a{3}bc/I
35 nigel 41
36 nigel 93 /(abc|a+z)/I
37 nigel 41
38 nigel 93 /^abc$/I
39 nigel 41 abc
40     *** Failers
41     def\nabc
42    
43 ph10 178 /ab\idef/X
44 nigel 41
45 ph10 178 /(?X)ab\idef/X
46 nigel 41
47     /x{5,4}/
48    
49     /z{65536}/
50    
51     /[abcd/
52    
53 nigel 63 /(?X)[\B]/
54 nigel 41
55 ph10 513 /(?X)[\R]/
56    
57     /(?X)[\X]/
58    
59     /[\B]/BZ
60    
61     /[\R]/BZ
62    
63     /[\X]/BZ
64    
65 nigel 41 /[z-a]/
66    
67     /^*/
68    
69     /(abc/
70    
71     /(?# abc/
72    
73     /(?z)abc/
74    
75 nigel 93 /.*b/I
76 nigel 41
77 nigel 93 /.*?b/I
78 nigel 41
79 nigel 93 /cat|dog|elephant/I
80 nigel 41 this sentence eventually mentions a cat
81     this sentences rambles on and on for a while and then reaches elephant
82    
83 nigel 93 /cat|dog|elephant/IS
84 nigel 41 this sentence eventually mentions a cat
85     this sentences rambles on and on for a while and then reaches elephant
86    
87 nigel 93 /cat|dog|elephant/IiS
88 nigel 41 this sentence eventually mentions a CAT cat
89     this sentences rambles on and on for a while to elephant ElePhant
90    
91 nigel 93 /a|[bcd]/IS
92 nigel 41
93 nigel 93 /(a|[^\dZ])/IS
94 nigel 41
95 nigel 93 /(a|b)*[\s]/IS
96 nigel 41
97     /(ab\2)/
98    
99     /{4,5}abc/
100    
101 nigel 93 /(a)(b)(c)\2/I
102 nigel 41 abcb
103     \O0abcb
104     \O3abcb
105     \O6abcb
106     \O9abcb
107 ph10 102 \O12abcb
108 nigel 41
109 nigel 93 /(a)bc|(a)(b)\2/I
110 nigel 41 abc
111     \O0abc
112     \O3abc
113     \O6abc
114     aba
115     \O0aba
116     \O3aba
117     \O6aba
118     \O9aba
119     \O12aba
120    
121 nigel 93 /abc$/IE
122 nigel 41 abc
123     *** Failers
124     abc\n
125     abc\ndef
126    
127     /(a)(b)(c)(d)(e)\6/
128    
129 nigel 93 /the quick brown fox/I
130 nigel 41 the quick brown fox
131     this is a line with the quick brown fox
132    
133 nigel 93 /the quick brown fox/IA
134 nigel 41 the quick brown fox
135     *** Failers
136     this is a line with the quick brown fox
137    
138     /ab(?z)cd/
139    
140 nigel 93 /^abc|def/I
141 nigel 41 abcdef
142     abcdef\B
143    
144 nigel 93 /.*((abc)$|(def))/I
145 nigel 41 defabc
146     \Zdefabc
147    
148     /)/
149    
150     /a[]b/
151    
152 nigel 93 /[^aeiou ]{3,}/I
153 ph10 102 co-processors, and for
154    
155 nigel 93 /<.*>/I
156 nigel 41 abc<def>ghi<klm>nop
157    
158 nigel 93 /<.*?>/I
159 nigel 41 abc<def>ghi<klm>nop
160    
161 nigel 93 /<.*>/IU
162 nigel 41 abc<def>ghi<klm>nop
163 ph10 102
164 nigel 93 /(?U)<.*>/I
165 nigel 41 abc<def>ghi<klm>nop
166    
167 nigel 93 /<.*?>/IU
168 nigel 41 abc<def>ghi<klm>nop
169 ph10 102
170 nigel 93 /={3,}/IU
171 nigel 41 abc========def
172 ph10 102
173 nigel 93 /(?U)={3,}?/I
174 nigel 41 abc========def
175 ph10 102
176 nigel 93 /(?<!bar|cattle)foo/I
177 nigel 41 foo
178 ph10 102 catfoo
179 nigel 41 *** Failers
180     the barfoo
181 ph10 102 and cattlefoo
182 nigel 41
183     /(?<=a+)b/
184    
185     /(?<=aaa|b{0,3})b/
186    
187     /(?<!(foo)a\1)bar/
188    
189 nigel 93 /(?i)abc/I
190 nigel 41
191 nigel 93 /(a|(?m)a)/I
192 nigel 41
193 nigel 93 /(?i)^1234/I
194 nigel 41
195 nigel 93 /(^b|(?i)^d)/I
196 nigel 41
197 nigel 93 /(?s).*/I
198 nigel 41
199 nigel 93 /[abcd]/IS
200 nigel 41
201 nigel 93 /(?i)[abcd]/IS
202 nigel 41
203 nigel 93 /(?m)[xy]|(b|c)/IS
204 nigel 41
205 nigel 93 /(^a|^b)/Im
206 nigel 41
207 nigel 93 /(?i)(^a|^b)/Im
208 nigel 41
209     /(a)(?(1)a|b|c)/
210    
211     /(?(?=a)a|b|c)/
212    
213     /(?(1a)/
214    
215 nigel 93 /(?(1a))/
216    
217 nigel 41 /(?(?i))/
218    
219     /(?(abc))/
220    
221     /(?(?<ab))/
222    
223 nigel 93 /((?s)blah)\s+\1/I
224 nigel 41
225 nigel 93 /((?i)blah)\s+\1/I
226 nigel 41
227 ph10 161 /((?i)b)/IDZS
228 nigel 41
229 nigel 93 /(a*b|(?i:c*(?-i)d))/IS
230 nigel 41
231 nigel 93 /a$/I
232 nigel 41 a
233     a\n
234 ph10 102 *** Failers
235 nigel 41 \Za
236 ph10 102 \Za\n
237 nigel 41
238 nigel 93 /a$/Im
239 nigel 41 a
240     a\n
241 ph10 102 \Za\n
242     *** Failers
243 nigel 41 \Za
244 ph10 102
245 nigel 93 /\Aabc/Im
246 nigel 41
247 ph10 102 /^abc/Im
248 nigel 41
249 nigel 93 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
250 nigel 41 aaaaabbbbbcccccdef
251    
252 nigel 93 /(?<=foo)[ab]/IS
253 nigel 41
254 nigel 93 /(?<!foo)(alpha|omega)/IS
255 nigel 41
256 nigel 93 /(?!alphabet)[ab]/IS
257 nigel 41
258 nigel 93 /(?<=foo\n)^bar/Im
259 ph10 102 foo\nbarbar
260 nigel 75 ***Failers
261 ph10 102 rhubarb
262 nigel 75 barbell
263 ph10 102 abc\nbarton
264 nigel 41
265 nigel 93 /^(?<=foo\n)bar/Im
266 ph10 102 foo\nbarbar
267 nigel 75 ***Failers
268 ph10 102 rhubarb
269 nigel 75 barbell
270 ph10 102 abc\nbarton
271 nigel 75
272 nigel 93 /(?>^abc)/Im
273 nigel 41 abc
274     def\nabc
275     *** Failers
276 ph10 102 defabc
277 nigel 41
278     /(?<=ab(c+)d)ef/
279    
280     /(?<=ab(?<=c+)d)ef/
281    
282     /(?<=ab(c|de)f)g/
283    
284     /The next three are in testinput2 because they have variable length branches/
285    
286 nigel 93 /(?<=bullock|donkey)-cart/I
287 nigel 41 the bullock-cart
288     a donkey-cart race
289     *** Failers
290     cart
291 ph10 102 horse-and-cart
292    
293 nigel 93 /(?<=ab(?i)x|y|z)/I
294 nigel 41
295 nigel 93 /(?>.*)(?<=(abcd)|(xyz))/I
296 nigel 41 alphabetabcd
297     endingxyz
298    
299 nigel 93 /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
300 nigel 41 abxyZZ
301     abXyZZ
302     ZZZ
303     zZZ
304     bZZ
305 ph10 102 BZZ
306 nigel 41 *** Failers
307 ph10 102 ZZ
308     abXYZZ
309 nigel 41 zzz
310 ph10 102 bzz
311 nigel 41
312 nigel 93 /(?<!(foo)a)bar/I
313 nigel 41 bar
314 ph10 102 foobbar
315 nigel 41 *** Failers
316 ph10 102 fooabar
317 nigel 41
318 ph10 488 /This one is here because Perl behaves differently; see also the following/I
319 nigel 41
320 nigel 93 /^(a\1?){4}$/I
321 ph10 488 aaaa
322 nigel 41 aaaaaa
323 ph10 488
324     /Perl does not fail these two for the final subjects. Neither did PCRE until/
325     /release 8.01. The problem is in backtracking into a subpattern that contains/
326     /a recursive reference to itself. PCRE has now made these into atomic patterns./
327 ph10 102
328 ph10 488 /^(xa|=?\1a){2}$/
329     xa=xaa
330     ** Failers
331     xa=xaaa
332    
333     /^(xa|=?\1a)+$/
334     xa=xaa
335     ** Failers
336     xa=xaaa
337    
338 nigel 93 /These are syntax tests from Perl 5.005/I
339 nigel 41
340     /a[b-a]/
341    
342     /a[]b/
343    
344     /a[/
345    
346     /*a/
347    
348     /(*)b/
349    
350     /abc)/
351    
352     /(abc/
353    
354     /a**/
355    
356     /)(/
357    
358     /\1/
359    
360     /\2/
361    
362     /(a)|\2/
363    
364 nigel 93 /a[b-a]/Ii
365 nigel 41
366 nigel 93 /a[]b/Ii
367 nigel 41
368 nigel 93 /a[/Ii
369 nigel 41
370 nigel 93 /*a/Ii
371 nigel 41
372 nigel 93 /(*)b/Ii
373 nigel 41
374 nigel 93 /abc)/Ii
375 nigel 41
376 nigel 93 /(abc/Ii
377 nigel 41
378 nigel 93 /a**/Ii
379 nigel 41
380 nigel 93 /)(/Ii
381 nigel 41
382     /:(?:/
383    
384     /(?<%)b/
385    
386     /a(?{)b/
387    
388     /a(?{{})b/
389    
390     /a(?{}})b/
391    
392     /a(?{"{"})b/
393    
394     /a(?{"{"}})b/
395    
396     /(?(1?)a|b)/
397    
398     /[a[:xyz:/
399    
400     /(?<=x+)y/
401    
402     /a{37,17}/
403    
404     /abc/\
405    
406     /abc/\i
407    
408 nigel 93 /(a)bc(d)/I
409 nigel 41 abcd
410     abcd\C2
411     abcd\C5
412 ph10 102
413 nigel 93 /(.{20})/I
414 nigel 41 abcdefghijklmnopqrstuvwxyz
415     abcdefghijklmnopqrstuvwxyz\C1
416     abcdefghijklmnopqrstuvwxyz\G1
417 ph10 102
418 nigel 93 /(.{15})/I
419 nigel 41 abcdefghijklmnopqrstuvwxyz
420     abcdefghijklmnopqrstuvwxyz\C1\G1
421    
422 nigel 93 /(.{16})/I
423 nigel 41 abcdefghijklmnopqrstuvwxyz
424     abcdefghijklmnopqrstuvwxyz\C1\G1\L
425 ph10 102
426 nigel 93 /^(a|(bc))de(f)/I
427 ph10 102 adef\G1\G2\G3\G4\L
428     bcdef\G1\G2\G3\G4\L
429     adefghijk\C0
430    
431 nigel 93 /^abc\00def/I
432 ph10 102 abc\00def\L\C0
433    
434     /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
435     )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
436 ph10 162 )?)?)?)?)?)?)?)?)?otherword/I
437 nigel 41
438 ph10 161 /.*X/IDZ
439 nigel 41
440 ph10 161 /.*X/IDZs
441 nigel 41
442 ph10 161 /(.*X|^B)/IDZ
443 nigel 41
444 ph10 161 /(.*X|^B)/IDZs
445 ph10 102
446 ph10 161 /(?s)(.*X|^B)/IDZ
447 nigel 41
448 ph10 161 /(?s:.*X|^B)/IDZ
449 nigel 41
450 nigel 93 /\Biss\B/I+
451 nigel 41 Mississippi
452    
453 nigel 93 /iss/IG+
454 nigel 41 Mississippi
455    
456 nigel 93 /\Biss\B/IG+
457 nigel 41 Mississippi
458    
459 nigel 93 /\Biss\B/Ig+
460 nigel 41 Mississippi
461     *** Failers
462     Mississippi\A
463    
464 nigel 93 /(?<=[Ms])iss/Ig+
465 nigel 41 Mississippi
466    
467 nigel 93 /(?<=[Ms])iss/IG+
468 nigel 41 Mississippi
469    
470 nigel 93 /^iss/Ig+
471 nigel 41 ississippi
472 ph10 102
473 nigel 93 /.*iss/Ig+
474 ph10 102 abciss\nxyzisspqr
475 nigel 41
476 nigel 93 /.i./I+g
477 nigel 41 Mississippi
478     Mississippi\A
479     Missouri river
480 ph10 102 Missouri river\A
481 nigel 41
482 nigel 93 /^.is/I+g
483 nigel 41 Mississippi
484    
485 nigel 93 /^ab\n/Ig+
486 nigel 41 ab\nab\ncd
487    
488 nigel 93 /^ab\n/Img+
489 nigel 41 ab\nab\ncd
490    
491 nigel 93 /abc/I
492 nigel 41
493 nigel 93 /abc|bac/I
494 nigel 41
495 nigel 93 /(abc|bac)/I
496 nigel 41
497 nigel 93 /(abc|(c|dc))/I
498 nigel 41
499 nigel 93 /(abc|(d|de)c)/I
500 nigel 41
501 nigel 93 /a*/I
502 nigel 41
503 nigel 93 /a+/I
504 nigel 41
505 nigel 93 /(baa|a+)/I
506 nigel 41
507 nigel 93 /a{0,3}/I
508 nigel 41
509 nigel 93 /baa{3,}/I
510 nigel 41
511 nigel 93 /"([^\\"]+|\\.)*"/I
512 nigel 41
513 nigel 93 /(abc|ab[cd])/I
514 nigel 41
515 nigel 93 /(a|.)/I
516 nigel 41
517 nigel 93 /a|ba|\w/I
518 nigel 41
519 nigel 93 /abc(?=pqr)/I
520 nigel 41
521 nigel 93 /...(?<=abc)/I
522 nigel 41
523 nigel 93 /abc(?!pqr)/I
524 nigel 41
525 nigel 93 /ab./I
526 nigel 41
527 nigel 93 /ab[xyz]/I
528 nigel 41
529 nigel 93 /abc*/I
530 nigel 41
531 nigel 93 /ab.c*/I
532 nigel 41
533 nigel 93 /a.c*/I
534 nigel 41
535 nigel 93 /.c*/I
536 nigel 41
537 nigel 93 /ac*/I
538 nigel 41
539 nigel 93 /(a.c*|b.c*)/I
540 nigel 41
541 nigel 93 /a.c*|aba/I
542 nigel 41
543 nigel 93 /.+a/I
544 nigel 41
545 nigel 93 /(?=abcda)a.*/I
546 nigel 41
547 nigel 93 /(?=a)a.*/I
548 nigel 41
549 nigel 93 /a(b)*/I
550 nigel 41
551 nigel 93 /a\d*/I
552 nigel 41
553 nigel 93 /ab\d*/I
554 nigel 41
555 nigel 93 /a(\d)*/I
556 nigel 41
557 nigel 93 /abcde{0,0}/I
558 nigel 41
559 nigel 93 /ab\d+/I
560 nigel 41
561 ph10 270 /a(?(1)b)(.)/I
562 nigel 41
563 ph10 270 /a(?(1)bag|big)(.)/I
564 nigel 41
565 ph10 270 /a(?(1)bag|big)*(.)/I
566 nigel 41
567 ph10 270 /a(?(1)bag|big)+(.)/I
568 nigel 41
569 ph10 270 /a(?(1)b..|b..)(.)/I
570 nigel 41
571 nigel 93 /ab\d{0}e/I
572 nigel 41
573 nigel 93 /a?b?/I
574 nigel 41 a
575     b
576     ab
577     \
578     *** Failers
579 ph10 102 \N
580    
581 nigel 93 /|-/I
582 nigel 41 abcd
583     -abc
584     \Nab-c
585     *** Failers
586 ph10 102 \Nabc
587 nigel 41
588 ph10 102 /^.?abcd/IS
589    
590 nigel 43 /\( # ( at start
591     (?: # Non-capturing bracket
592     (?>[^()]+) # Either a sequence of non-brackets (no backtracking)
593     | # Or
594     (?R) # Recurse - i.e. nested bracketed string
595     )* # Zero or more contents
596     \) # Closing )
597 nigel 93 /Ix
598 nigel 43 (abcd)
599     (abcd)xyz
600     xyz(abcd)
601 ph10 102 (ab(xy)cd)pqr
602     (ab(xycd)pqr
603     () abc ()
604 nigel 43 12(abcde(fsh)xyz(foo(bar))lmno)89
605     *** Failers
606 ph10 102 abcd
607 nigel 43 abcd)
608 ph10 102 (abcd
609 nigel 43
610 nigel 93 /\( ( (?>[^()]+) | (?R) )* \) /Ixg
611 ph10 102 (ab(xy)cd)pqr
612 nigel 43 1(abcd)(x(y)z)pqr
613    
614 nigel 93 /\( (?: (?>[^()]+) | (?R) ) \) /Ix
615 nigel 43 (abcd)
616     (ab(xy)cd)
617 ph10 102 (a(b(c)d)e)
618     ((ab))
619 nigel 43 *** Failers
620 ph10 102 ()
621 nigel 43
622 nigel 93 /\( (?: (?>[^()]+) | (?R) )? \) /Ix
623 nigel 43 ()
624     12(abcde(fsh)xyz(foo(bar))lmno)89
625    
626 nigel 93 /\( ( (?>[^()]+) | (?R) )* \) /Ix
627 nigel 43 (ab(xy)cd)
628    
629 nigel 93 /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
630 nigel 43 (ab(xy)cd)
631    
632 nigel 93 /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
633 nigel 43 (ab(xy)cd)
634     (123ab(xy)cd)
635    
636 nigel 93 /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
637 nigel 43 (ab(xy)cd)
638     (123ab(xy)cd)
639    
640 nigel 93 /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
641 nigel 43 (ab(xy)cd)
642    
643 nigel 93 /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
644 nigel 43 (abcd(xyz<p>qrs)123)
645    
646 nigel 93 /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
647 nigel 43 (ab(cd)ef)
648     (ab(cd(ef)gh)ij)
649    
650 ph10 161 /^[[:alnum:]]/DZ
651 nigel 43
652 ph10 161 /^[[:^alnum:]]/DZ
653 nigel 75
654 ph10 161 /^[[:alpha:]]/DZ
655 nigel 75
656 ph10 161 /^[[:^alpha:]]/DZ
657 ph10 102
658 nigel 87 /[_[:alpha:]]/IS
659    
660 ph10 161 /^[[:ascii:]]/DZ
661 nigel 43
662 ph10 161 /^[[:^ascii:]]/DZ
663 nigel 75
664 ph10 161 /^[[:blank:]]/DZ
665 nigel 63
666 ph10 161 /^[[:^blank:]]/DZ
667 nigel 87
668     /[\n\x0b\x0c\x0d[:blank:]]/IS
669    
670 ph10 161 /^[[:cntrl:]]/DZ
671 nigel 43
672 ph10 161 /^[[:digit:]]/DZ
673 nigel 43
674 ph10 161 /^[[:graph:]]/DZ
675 nigel 43
676 ph10 161 /^[[:lower:]]/DZ
677 nigel 43
678 ph10 161 /^[[:print:]]/DZ
679 nigel 43
680 ph10 161 /^[[:punct:]]/DZ
681 nigel 43
682 ph10 161 /^[[:space:]]/DZ
683 nigel 43
684 ph10 161 /^[[:upper:]]/DZ
685 nigel 43
686 ph10 161 /^[[:xdigit:]]/DZ
687 nigel 43
688 ph10 161 /^[[:word:]]/DZ
689 nigel 43
690 ph10 161 /^[[:^cntrl:]]/DZ
691 nigel 43
692 ph10 161 /^[12[:^digit:]]/DZ
693 nigel 43
694 ph10 161 /^[[:^blank:]]/DZ
695 nigel 63
696 ph10 161 /[01[:alpha:]%]/DZ
697 nigel 43
698 nigel 93 /[[.ch.]]/I
699 nigel 43
700 nigel 93 /[[=ch=]]/I
701 nigel 43
702 nigel 93 /[[:rhubarb:]]/I
703 nigel 43
704 nigel 93 /[[:upper:]]/Ii
705 nigel 43 A
706 ph10 102 a
707    
708 nigel 93 /[[:lower:]]/Ii
709 nigel 43 A
710 ph10 102 a
711 nigel 43
712 nigel 93 /((?-i)[[:lower:]])[[:lower:]]/Ii
713 nigel 43 ab
714     aB
715     *** Failers
716     Ab
717 ph10 102 AB
718 nigel 43
719 nigel 93 /[\200-\110]/I
720 nigel 49
721 nigel 93 /^(?(0)f|b)oo/I
722 nigel 51
723 nigel 93 /This one's here because of the large output vector needed/I
724 nigel 53
725 nigel 93 /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
726 nigel 53 \O900 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC
727    
728 nigel 93 /This one's here because Perl does this differently and PCRE can't at present/I
729 nigel 53
730 nigel 93 /(main(O)?)+/I
731 nigel 53 mainmain
732     mainOmain
733 ph10 102
734 nigel 93 /These are all cases where Perl does it differently (nested captures)/I
735 nigel 63
736 nigel 93 /^(a(b)?)+$/I
737 nigel 63 aba
738 ph10 102
739 nigel 93 /^(aa(bb)?)+$/I
740 ph10 102 aabbaa
741    
742 nigel 93 /^(aa|aa(bb))+$/I
743 ph10 102 aabbaa
744    
745 nigel 93 /^(aa(bb)??)+$/I
746 ph10 102 aabbaa
747    
748 nigel 93 /^(?:aa(bb)?)+$/I
749 ph10 102 aabbaa
750    
751 nigel 93 /^(aa(b(b))?)+$/I
752 ph10 102 aabbaa
753 nigel 63
754 nigel 93 /^(?:aa(b(b))?)+$/I
755 ph10 102 aabbaa
756 nigel 63
757 nigel 93 /^(?:aa(b(?:b))?)+$/I
758 ph10 102 aabbaa
759 nigel 63
760 nigel 93 /^(?:aa(bb(?:b))?)+$/I
761 ph10 102 aabbbaa
762    
763 nigel 93 /^(?:aa(b(?:bb))?)+$/I
764 ph10 102 aabbbaa
765 nigel 63
766 nigel 93 /^(?:aa(?:b(b))?)+$/I
767 ph10 102 aabbaa
768 nigel 63
769 nigel 93 /^(?:aa(?:b(bb))?)+$/I
770 ph10 102 aabbbaa
771 nigel 63
772 nigel 93 /^(aa(b(bb))?)+$/I
773 ph10 102 aabbbaa
774 nigel 63
775 nigel 93 /^(aa(bb(bb))?)+$/I
776 ph10 102 aabbbbaa
777 nigel 63
778 ph10 102 /--------------------------------------------------------------------/I
779    
780 ph10 162 /#/IxDZ
781 nigel 63
782 ph10 162 /a#/IxDZ
783 nigel 63
784 ph10 161 /[\s]/DZ
785 nigel 63
786 ph10 161 /[\S]/DZ
787 nigel 63
788 ph10 161 /a(?i)b/DZ
789 nigel 63 ab
790     aB
791 ph10 102 *** Failers
792     AB
793 nigel 63
794 ph10 161 /(a(?i)b)/DZ
795 nigel 63 ab
796     aB
797 ph10 102 *** Failers
798     AB
799    
800 ph10 161 / (?i)abc/IxDZ
801 nigel 63
802     /#this is a comment
803 ph10 161 (?i)abc/IxDZ
804 nigel 63
805 ph10 161 /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
806 nigel 63
807 ph10 161 /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
808 nigel 63
809 ph10 161 /\Q\E/DZ
810 nigel 63 \
811    
812 ph10 161 /\Q\Ex/DZ
813 nigel 63
814 ph10 161 / \Q\E/DZ
815 nigel 63
816 ph10 161 /a\Q\E/DZ
817 nigel 63 abc
818     bca
819 ph10 102 bac
820 nigel 63
821 ph10 161 /a\Q\Eb/DZ
822 nigel 63 abc
823    
824 ph10 161 /\Q\Eabc/DZ
825 nigel 63
826 ph10 161 /x*+\w/DZ
827 nigel 63 *** Failers
828     xxxxx
829 ph10 102
830 ph10 161 /x?+/DZ
831 nigel 63
832 ph10 161 /x++/DZ
833 nigel 63
834 ph10 1380 /x{1,3}+/BZO
835 nigel 63
836 ph10 1380 /x{1,3}+/BZOi
837    
838     /[^x]{1,3}+/BZO
839    
840     /[^x]{1,3}+/BZOi
841    
842 ph10 161 /(x)*+/DZ
843 nigel 63
844 nigel 93 /^(\w++|\s++)*$/I
845 nigel 63 now is the time for all good men to come to the aid of the party
846     *** Failers
847     this is not a line with only words and spaces!
848 ph10 102
849 nigel 93 /(\d++)(\w)/I
850 nigel 63 12345a
851     *** Failers
852 ph10 102 12345+
853 nigel 63
854 nigel 93 /a++b/I
855 nigel 63 aaab
856    
857 nigel 93 /(a++b)/I
858 nigel 63 aaab
859    
860 nigel 93 /(a++)b/I
861 nigel 63 aaab
862    
863 nigel 93 /([^()]++|\([^()]*\))+/I
864 nigel 63 ((abc(ade)ufh()()x
865 ph10 102
866     /\(([^()]++|\([^()]+\))+\)/I
867 nigel 63 (abc)
868     (abc(def)xyz)
869     *** Failers
870 ph10 102 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
871 nigel 63
872 ph10 161 /(abc){1,3}+/DZ
873 nigel 63
874 nigel 93 /a+?+/I
875 nigel 63
876 nigel 93 /a{2,3}?+b/I
877 nigel 63
878 nigel 93 /(?U)a+?+/I
879 nigel 63
880 nigel 93 /a{2,3}?+b/IU
881 nigel 63
882 ph10 161 /x(?U)a++b/DZ
883 nigel 63 xaaaab
884    
885 ph10 161 /(?U)xa++b/DZ
886 nigel 63 xaaaab
887    
888 ph10 161 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/DZ
889 nigel 63
890 ph10 161 /^x(?U)a+b/DZ
891 nigel 63
892 ph10 161 /^x(?U)(a+)b/DZ
893 nigel 63
894 nigel 93 /[.x.]/I
895 nigel 63
896 nigel 93 /[=x=]/I
897 nigel 63
898 nigel 93 /[:x:]/I
899 nigel 63
900 nigel 93 /\l/I
901 nigel 63
902 nigel 93 /\L/I
903 nigel 63
904 nigel 93 /\N{name}/I
905 nigel 63
906 nigel 93 /\u/I
907 nigel 63
908 nigel 93 /\U/I
909 nigel 63
910 ph10 1462 /a{1,3}b/U
911     ab
912    
913 nigel 93 /[/I
914 nigel 63
915 nigel 93 /[a-/I
916 nigel 63
917 nigel 93 /[[:space:]/I
918 nigel 63
919 ph10 162 /[\s]/IDZ
920 nigel 63
921 ph10 162 /[[:space:]]/IDZ
922 nigel 63
923 ph10 162 /[[:space:]abcde]/IDZ
924 nigel 63
925 nigel 93 /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
926 nigel 63 <>
927     <abcd>
928     <abc <123> hij>
929     <abc <def> hij>
930 ph10 102 <abc<>def>
931     <abc<>
932 nigel 63 *** Failers
933     <abc
934    
935 ph10 162 |8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|IDZ
936 nigel 63
937 ph10 162 |\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|IDZ
938 nigel 63
939     /(.*)\d+\1/I
940    
941     /(.*)\d+/I
942 ph10 102
943 nigel 63 /(.*)\d+\1/Is
944    
945     /(.*)\d+/Is
946    
947     /(.*(xyz))\d+\2/I
948    
949     /((.*))\d+\1/I
950     abc123bc
951 ph10 102
952 nigel 63 /a[b]/I
953    
954     /(?=a).*/I
955    
956 nigel 93 /(?=abc).xyz/IiI
957 nigel 63
958     /(?=abc)(?i).xyz/I
959    
960     /(?=a)(?=b)/I
961    
962     /(?=.)a/I
963    
964     /((?=abcda)a)/I
965    
966     /((?=abcda)ab)/I
967    
968     /()a/I
969    
970 ph10 270 /(?(1)ab|ac)(.)/I
971 nigel 63
972 ph10 270 /(?(1)abz|acz)(.)/I
973 nigel 63
974 ph10 270 /(?(1)abz)(.)/I
975 nigel 63
976 ph10 270 /(?(1)abz)(1)23/I
977 nigel 63
978     /(a)+/I
979    
980     /(a){2,3}/I
981    
982     /(a)*/I
983    
984     /[a]/I
985    
986     /[ab]/I
987    
988     /[ab]/IS
989    
990     /[^a]/I
991    
992     /\d456/I
993    
994     /\d456/IS
995    
996     /a^b/I
997    
998 nigel 93 /^a/Im
999 nigel 63 abcde
1000 ph10 102 xy\nabc
1001     *** Failers
1002     xyabc
1003 nigel 63
1004     /c|abc/I
1005    
1006     /(?i)[ab]/IS
1007    
1008     /[ab](?i)cd/IS
1009    
1010 nigel 93 /abc(?C)def/I
1011 nigel 63 abcdef
1012 ph10 102 1234abcdef
1013 nigel 63 *** Failers
1014     abcxyz
1015 ph10 102 abcxyzf
1016 nigel 63
1017 nigel 93 /abc(?C)de(?C1)f/I
1018 nigel 63 123abcdef
1019 ph10 102
1020 ph10 612 /(?C1)\dabc(?C2)def/IS
1021 nigel 63 1234abcdef
1022     *** Failers
1023 ph10 102 abcdef
1024    
1025 ph10 612 /(?C1)\dabc(?C2)def/ISS
1026     1234abcdef
1027     *** Failers
1028     abcdef
1029    
1030 nigel 93 /(?C255)ab/I
1031 nigel 63
1032 nigel 93 /(?C256)ab/I
1033 nigel 63
1034 ph10 102 /(?Cab)xx/I
1035 nigel 63
1036 nigel 93 /(?C12vr)x/I
1037 nigel 63
1038 nigel 93 /abc(?C)def/I
1039 nigel 63 *** Failers
1040     \x83\x0\x61bcdef
1041    
1042 nigel 93 /(abc)(?C)de(?C1)f/I
1043 nigel 63 123abcdef
1044 ph10 102 123abcdef\C+
1045     123abcdef\C-
1046 nigel 63 *** Failers
1047 ph10 102 123abcdef\C!1
1048    
1049 nigel 93 /(?C0)(abc(?C1))*/I
1050 nigel 63 abcabcabc
1051 ph10 102 abcabc\C!1!3
1052 nigel 63 *** Failers
1053 ph10 102 abcabcabc\C!1!3
1054 nigel 63
1055 nigel 93 /(\d{3}(?C))*/I
1056 nigel 63 123\C+
1057     123456\C+
1058 ph10 102 123456789\C+
1059 nigel 63
1060 nigel 93 /((xyz)(?C)p|(?C1)xyzabc)/I
1061 nigel 63 xyzabc\C+
1062    
1063 nigel 93 /(X)((xyz)(?C)p|(?C1)xyzabc)/I
1064 nigel 63 Xxyzabc\C+
1065    
1066 nigel 93 /(?=(abc))(?C)abcdef/I
1067 nigel 63 abcdef\C+
1068 ph10 102
1069 nigel 93 /(?!(abc)(?C1)d)(?C2)abcxyz/I
1070 ph10 102 abcxyz\C+
1071 nigel 63
1072 nigel 93 /(?<=(abc)(?C))xyz/I
1073 nigel 63 abcxyz\C+
1074 ph10 102
1075 nigel 93 /a(b+)(c*)(?C1)/I
1076 nigel 77 abbbbbccc\C*1
1077    
1078 nigel 93 /a(b+?)(c*?)(?C1)/I
1079 nigel 77 abbbbbccc\C*1
1080 nigel 63
1081 ph10 102 /(?C)abc/I
1082    
1083 nigel 93 /(?C)^abc/I
1084 nigel 63
1085 nigel 93 /(?C)a|b/IS
1086 nigel 63
1087 nigel 93 /(?R)/I
1088 nigel 63
1089 nigel 93 /(a|(?R))/I
1090 nigel 63
1091 nigel 93 /(ab|(bc|(de|(?R))))/I
1092 nigel 63
1093 nigel 93 /x(ab|(bc|(de|(?R))))/I
1094 nigel 63 xab
1095     xbc
1096     xde
1097     xxab
1098     xxxab
1099     *** Failers
1100 ph10 102 xyab
1101 nigel 63
1102 nigel 93 /(ab|(bc|(de|(?1))))/I
1103 nigel 63
1104 nigel 93 /x(ab|(bc|(de|(?1)x)x)x)/I
1105 nigel 63
1106 nigel 93 /^([^()]|\((?1)*\))*$/I
1107 nigel 63 abc
1108     a(b)c
1109 ph10 102 a(b(c))d
1110 nigel 63 *** Failers)
1111 ph10 102 a(b(c)d
1112 nigel 63
1113 nigel 93 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
1114 nigel 63 >abc>123<xyz<
1115     >abc>1(2)3<xyz<
1116     >abc>(1(2)3)<xyz<
1117    
1118 ph10 161 /(a(?1)b)/DZ
1119 nigel 63
1120 ph10 161 /(a(?1)+b)/DZ
1121 nigel 63
1122 nigel 93 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
1123 nigel 63 12
1124     (((2+2)*-3)-7)
1125     -12
1126     *** Failers
1127     ((2+2)*-3)-7)
1128 ph10 102
1129 nigel 93 /^(x(y|(?1){2})z)/I
1130 nigel 63 xyz
1131 ph10 102 xxyzxyzz
1132 nigel 63 *** Failers
1133     xxyzz
1134 ph10 102 xxyzxyzxyzz
1135 nigel 63
1136 nigel 93 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
1137 nigel 63 <>
1138     <abcd>
1139     <abc <123> hij>
1140     <abc <def> hij>
1141 ph10 102 <abc<>def>
1142     <abc<>
1143 nigel 63 *** Failers
1144     <abc
1145    
1146 nigel 93 /(?1)/I
1147 nigel 63
1148 nigel 93 /((?2)(abc)/I
1149 nigel 63
1150 nigel 93 /^(abc)def(?1)/I
1151 nigel 63 abcdefabc
1152    
1153 nigel 93 /^(a|b|c)=(?1)+/I
1154 nigel 63 a=a
1155     a=b
1156 ph10 102 a=bc
1157 nigel 63
1158 nigel 93 /^(a|b|c)=((?1))+/I
1159 nigel 63 a=a
1160     a=b
1161 ph10 102 a=bc
1162 nigel 63
1163 ph10 161 /a(?P<name1>b|c)d(?P<longername2>e)/DZ
1164 nigel 63 abde
1165 ph10 102 acde
1166 nigel 63
1167 ph10 161 /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/DZ
1168 nigel 63
1169 ph10 161 /(?P<a>a)...(?P=a)bbb(?P>a)d/DZ
1170 nigel 63
1171 nigel 93 /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
1172 nigel 63 1221
1173     Satan, oscillate my metallic sonatas!
1174     A man, a plan, a canal: Panama!
1175 ph10 102 Able was I ere I saw Elba.
1176 nigel 63 *** Failers
1177 ph10 102 The quick brown fox
1178    
1179 nigel 93 /((?(R)a|b))\1(?1)?/I
1180 nigel 63 bb
1181 ph10 102 bbaa
1182 nigel 63
1183 nigel 93 /(.*)a/Is
1184 nigel 63
1185 nigel 93 /(.*)a\1/Is
1186 nigel 63
1187 nigel 93 /(.*)a(b)\2/Is
1188 nigel 63
1189 nigel 93 /((.*)a|(.*)b)z/Is
1190 nigel 63
1191 nigel 93 /((.*)a|(.*)b)z\1/Is
1192 nigel 63
1193 nigel 93 /((.*)a|(.*)b)z\2/Is
1194 nigel 63
1195 nigel 93 /((.*)a|(.*)b)z\3/Is
1196 nigel 63
1197 nigel 93 /((.*)a|^(.*)b)z\3/Is
1198 nigel 63
1199 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
1200 nigel 63
1201 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
1202 nigel 63
1203 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
1204 nigel 63
1205 ph10 161 /(a)(bc)/INDZ
1206 nigel 63 abc
1207    
1208 ph10 161 /(?P<one>a)(bc)/INDZ
1209 nigel 63 abc
1210    
1211 ph10 161 /(a)(?P<named>bc)/INDZ
1212 nigel 63
1213 nigel 93 /(a+)*zz/I
1214 nigel 63 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
1215     aaaaaaaaaaaaaz\M
1216    
1217 nigel 93 /(aaa(?C1)bbb|ab)/I
1218 nigel 63 aaabbb
1219     aaabbb\C*0
1220     aaabbb\C*1
1221     aaabbb\C*-1
1222    
1223 nigel 93 /ab(?P<one>cd)ef(?P<two>gh)/I
1224 nigel 63 abcdefgh
1225     abcdefgh\C1\Gtwo
1226     abcdefgh\Cone\Ctwo
1227 ph10 102 abcdefgh\Cthree
1228 nigel 63
1229 ph10 161 /(?P<Tes>)(?P<Test>)/DZ
1230 nigel 63
1231 ph10 161 /(?P<Test>)(?P<Tes>)/DZ
1232 nigel 63
1233 nigel 93 /(?P<Z>zz)(?P<A>aa)/I
1234 nigel 63 zzaa\CZ
1235     zzaa\CA
1236    
1237 nigel 93 /(?P<x>eks)(?P<x>eccs)/I
1238 nigel 65
1239 nigel 93 /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
1240 nigel 65
1241 nigel 93 "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
1242 nigel 73 [10,20,30,5,5,4,4,2,43,23,4234]
1243     *** Failers
1244 ph10 102 []
1245 nigel 73
1246 nigel 93 "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
1247 nigel 73 [10,20,30,5,5,4,4,2,43,23,4234]
1248 ph10 102 []
1249 nigel 73
1250 ph10 161 /(a(b(?2)c))?/DZ
1251 nigel 73
1252 ph10 161 /(a(b(?2)c))*/DZ
1253 nigel 73
1254 ph10 161 /(a(b(?2)c)){0,2}/DZ
1255 nigel 73
1256 ph10 161 /[ab]{1}+/DZ
1257 nigel 73
1258 nigel 93 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
1259 nigel 73 Baby Bjorn Active Carrier - With free SHIPPING!!
1260    
1261 nigel 93 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS
1262 nigel 73 Baby Bjorn Active Carrier - With free SHIPPING!!
1263 ph10 102
1264 ph10 161 /a*.*b/ISDZ
1265 nigel 73
1266 ph10 161 /(a|b)*.?c/ISDZ
1267 nigel 73
1268 ph10 161 /abc(?C255)de(?C)f/DZ
1269 nigel 75
1270 ph10 161 /abcde/ICDZ
1271 nigel 75 abcde
1272 ph10 102 abcdfe
1273    
1274 ph10 612 /a*b/ICDZS
1275 nigel 75 ab
1276     aaaab
1277 ph10 102 aaaacb
1278 nigel 75
1279 ph10 612 /a*b/ICDZSS
1280     ab
1281     aaaab
1282     aaaacb
1283    
1284 ph10 161 /a+b/ICDZ
1285 nigel 75 ab
1286     aaaab
1287 ph10 102 aaaacb
1288 nigel 75
1289 ph10 612 /(abc|def)x/ICDZS
1290 nigel 75 abcx
1291     defx
1292 ph10 612 ** Failers
1293 nigel 75 abcdefzx
1294    
1295 ph10 612 /(abc|def)x/ICDZSS
1296     abcx
1297     defx
1298     ** Failers
1299     abcdefzx
1300    
1301 nigel 93 /(ab|cd){3,4}/IC
1302 nigel 75 ababab
1303     abcdabcd
1304 ph10 102 abcdcdcdcdcd
1305 nigel 75
1306 ph10 612 /([ab]{,4}c|xy)/ICDZS
1307 nigel 75 Note: that { does NOT introduce a quantifier
1308    
1309 ph10 612 /([ab]{,4}c|xy)/ICDZSS
1310     Note: that { does NOT introduce a quantifier
1311    
1312 ph10 161 /([ab]{1,4}c|xy){4,5}?123/ICDZ
1313 nigel 75 aacaacaacaacaac123
1314    
1315     /\b.*/I
1316     ab cd\>1
1317 ph10 102
1318     /\b.*/Is
1319 nigel 75 ab cd\>1
1320 ph10 102
1321 nigel 75 /(?!.bcd).*/I
1322 ph10 102 Xbcd12345
1323 nigel 75
1324 nigel 93 /abcde/I
1325 nigel 75 ab\P
1326     abc\P
1327     abcd\P
1328 ph10 102 abcde\P
1329 nigel 75 the quick brown abc\P
1330     ** Failers\P
1331     the quick brown abxyz fox\P
1332 ph10 102
1333 nigel 93 "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
1334 nigel 75 13/05/04\P
1335     13/5/2004\P
1336 ph10 102 02/05/09\P
1337 nigel 75 1\P
1338     1/2\P
1339     1/2/0\P
1340 ph10 102 1/2/04\P
1341 nigel 75 0\P
1342     02/\P
1343 ph10 102 02/0\P
1344 nigel 75 02/1\P
1345     ** Failers\P
1346     \P
1347     123\P
1348     33/4/04\P
1349     3/13/04\P
1350     0/1/2003\P
1351 ph10 102 0/\P
1352     02/0/\P
1353     02/13\P
1354 nigel 75
1355     /0{0,2}ABC/I
1356 ph10 102
1357 nigel 75 /\d{3,}ABC/I
1358 ph10 102
1359 nigel 75 /\d*ABC/I
1360    
1361     /[abc]+DE/I
1362    
1363 nigel 93 /[abc]?123/I
1364 nigel 75 123\P
1365     a\P
1366     b\P
1367     c\P
1368     c12\P
1369 ph10 102 c123\P
1370 nigel 75
1371 nigel 93 /^(?:\d){3,5}X/I
1372 nigel 75 1\P
1373     123\P
1374     123X
1375     1234\P
1376     1234X
1377     12345\P
1378 ph10 102 12345X
1379     *** Failers
1380     1X
1381     123456\P
1382 nigel 75
1383 ph10 1526 //KF>/dev/null
1384    
1385 ph10 612 /abc/IS>testsavedregex
1386 nigel 75 <testsavedregex
1387     abc
1388     ** Failers
1389     bca
1390 ph10 102
1391 ph10 612 /abc/ISS>testsavedregex
1392 nigel 75 <testsavedregex
1393     abc
1394     ** Failers
1395     bca
1396    
1397 ph10 612 /abc/IFS>testsavedregex
1398     <testsavedregex
1399     abc
1400     ** Failers
1401     bca
1402    
1403     /abc/IFSS>testsavedregex
1404     <testsavedregex
1405     abc
1406     ** Failers
1407     bca
1408    
1409 nigel 93 /(a|b)/IS>testsavedregex
1410 nigel 75 <testsavedregex
1411     abc
1412     ** Failers
1413 ph10 102 def
1414    
1415 ph10 612 /(a|b)/ISS>testsavedregex
1416     <testsavedregex
1417     abc
1418     ** Failers
1419     def
1420    
1421 nigel 93 /(a|b)/ISF>testsavedregex
1422 nigel 75 <testsavedregex
1423     abc
1424     ** Failers
1425 ph10 102 def
1426    
1427 ph10 612 /(a|b)/ISSF>testsavedregex
1428     <testsavedregex
1429     abc
1430     ** Failers
1431     def
1432    
1433 nigel 93 ~<(\w+)/?>(.)*</(\1)>~smgI
1434 ph10 666 \J1024<!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>
1435 nigel 75
1436     /^a/IF
1437    
1438 nigel 93 /line\nbreak/I
1439 nigel 77 this is a line\nbreak
1440 ph10 102 line one\nthis is a line\nbreak in the second line
1441 nigel 77
1442 nigel 93 /line\nbreak/If
1443 nigel 77 this is a line\nbreak
1444 ph10 102 ** Failers
1445     line one\nthis is a line\nbreak in the second line
1446 nigel 77
1447 nigel 93 /line\nbreak/Imf
1448 nigel 77 this is a line\nbreak
1449 ph10 102 ** Failers
1450     line one\nthis is a line\nbreak in the second line
1451 nigel 77
1452 nigel 93 /(?i)(?-i)AbCd/I
1453 nigel 79 AbCd
1454     ** Failers
1455 ph10 102 abcd
1456    
1457 nigel 93 /a{11111111111111111111}/I
1458 nigel 79
1459 nigel 93 /(){64294967295}/I
1460 nigel 81
1461 nigel 93 /(){2,4294967295}/I
1462 nigel 81
1463 nigel 93 "(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
1464 nigel 81 abcdefghijklAkB
1465    
1466 nigel 93 "(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B"I
1467 nigel 81 abcdefghijklAkB
1468    
1469 nigel 93 "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
1470 nigel 81 abcdefghijklAkB
1471    
1472 nigel 93 "(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)"I
1473 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1474    
1475 nigel 93 "(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)"I
1476 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1477    
1478 nigel 93 /[^()]*(?:\((?R)\)[^()]*)*/I
1479 nigel 87 (this(and)that
1480 ph10 102 (this(and)that)
1481 nigel 87 (this(and)that)stuff
1482    
1483 nigel 93 /[^()]*(?:\((?>(?R))\)[^()]*)*/I
1484 nigel 87 (this(and)that
1485 ph10 102 (this(and)that)
1486    
1487 nigel 93 /[^()]*(?:\((?R)\))*[^()]*/I
1488 nigel 87 (this(and)that
1489 ph10 102 (this(and)that)
1490 nigel 87
1491 nigel 93 /(?:\((?R)\))*[^()]*/I
1492 nigel 87 (this(and)that
1493 ph10 102 (this(and)that)
1494     ((this))
1495 nigel 87
1496 nigel 93 /(?:\((?R)\))|[^()]*/I
1497 nigel 87 (this(and)that
1498 ph10 102 (this(and)that)
1499 nigel 87 (this)
1500 ph10 102 ((this))
1501    
1502 nigel 93 /\x{0000ff}/I
1503 nigel 87
1504 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/I
1505 nigel 91
1506 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1507 nigel 91 a1b\CA
1508 ph10 102 a2b\CA
1509 nigel 91 ** Failers
1510 ph10 102 a1b\CZ\CA
1511 ph10 1359
1512     /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/IJ
1513 ph10 102
1514 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1515 nigel 91 ab\CA
1516 ph10 102
1517 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1518 nigel 91 ab\CA
1519 ph10 102 cd\CA
1520    
1521 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1522 ph10 102 cdefgh\CA
1523    
1524 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1525 nigel 91 a1b\GA
1526 ph10 102 a2b\GA
1527 nigel 91 ** Failers
1528 ph10 102 a1b\GZ\GA
1529    
1530 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1531 nigel 91 ab\GA
1532 ph10 102
1533 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1534 nigel 91 ab\GA
1535 ph10 102 cd\GA
1536    
1537 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1538 ph10 102 cdefgh\GA
1539    
1540 nigel 93 /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
1541 nigel 91 a1b\CA
1542 ph10 102 a2b\CA
1543    
1544 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
1545 nigel 91
1546     / In this next test, J is not set at the outer level; consequently it isn't
1547 ph10 102 set in the pattern's options; consequently pcre_get_named_substring() produces
1548 nigel 93 a random value. /Ix
1549 nigel 91
1550 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
1551 nigel 91 a bc d\CA\CB\CC
1552    
1553 nigel 93 /^(?P<A>a)?(?(A)a|b)/I
1554 nigel 91 aabc
1555     bc
1556     ** Failers
1557 ph10 102 abc
1558 nigel 91
1559 nigel 93 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
1560 nigel 91 bXaX
1561    
1562 nigel 93 /(?:(?(2y)a|b)(X))+/I
1563 nigel 91
1564 nigel 93 /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
1565 nigel 91
1566 nigel 93 /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
1567 nigel 91 bbXaaX
1568    
1569 nigel 93 /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
1570 nigel 91 (b)\\Xa\\X
1571    
1572 nigel 93 /(?P<ABC/I
1573 nigel 91
1574 nigel 93 /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1575 nigel 91 bXXaYYaY
1576 ph10 102 bXYaXXaX
1577 nigel 91
1578 nigel 93 /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1579 nigel 91 bXXaYYaY
1580    
1581 nigel 93 /\s*,\s*/IS
1582 nigel 91 \x0b,\x0b
1583 ph10 102 \x0c,\x0d
1584 nigel 91
1585 nigel 93 /^abc/Im
1586 nigel 91 xyz\nabc
1587     xyz\nabc\<lf>
1588     xyz\r\nabc\<lf>
1589     xyz\rabc\<cr>
1590     xyz\r\nabc\<crlf>
1591 ph10 102 ** Failers
1592 nigel 91 xyz\nabc\<cr>
1593     xyz\r\nabc\<cr>
1594     xyz\nabc\<crlf>
1595     xyz\rabc\<crlf>
1596     xyz\rabc\<lf>
1597 ph10 102
1598 nigel 93 /abc$/Im<lf>
1599 nigel 91 xyzabc
1600 ph10 102 xyzabc\n
1601     xyzabc\npqr
1602     xyzabc\r\<cr>
1603     xyzabc\rpqr\<cr>
1604     xyzabc\r\n\<crlf>
1605     xyzabc\r\npqr\<crlf>
1606 nigel 91 ** Failers
1607 ph10 102 xyzabc\r
1608     xyzabc\rpqr
1609     xyzabc\r\n
1610     xyzabc\r\npqr
1611    
1612 nigel 93 /^abc/Im<cr>
1613 nigel 91 xyz\rabcdef
1614     xyz\nabcdef\<lf>
1615 ph10 102 ** Failers
1616 nigel 91 xyz\nabcdef
1617 ph10 102
1618 nigel 93 /^abc/Im<lf>
1619 nigel 91 xyz\nabcdef
1620     xyz\rabcdef\<cr>
1621 ph10 102 ** Failers
1622 nigel 91 xyz\rabcdef
1623 ph10 102
1624 nigel 93 /^abc/Im<crlf>
1625 nigel 91 xyz\r\nabcdef
1626     xyz\rabcdef\<cr>
1627 ph10 102 ** Failers
1628 nigel 91 xyz\rabcdef
1629 ph10 102
1630 nigel 93 /^abc/Im<bad>
1631 nigel 91
1632 nigel 93 /abc/I
1633 nigel 91 xyz\rabc\<bad>
1634 ph10 102 abc
1635    
1636 nigel 93 /.*/I<lf>
1637 nigel 91 abc\ndef
1638     abc\rdef
1639     abc\r\ndef
1640     \<cr>abc\ndef
1641     \<cr>abc\rdef
1642     \<cr>abc\r\ndef
1643     \<crlf>abc\ndef
1644     \<crlf>abc\rdef
1645     \<crlf>abc\r\ndef
1646    
1647 nigel 93 /\w+(.)(.)?def/Is
1648 nigel 91 abc\ndef
1649     abc\rdef
1650     abc\r\ndef
1651    
1652 nigel 93 +((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I
1653 nigel 91 /* this is a C style comment */\M
1654    
1655 nigel 93 /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
1656 nigel 91
1657 nigel 93 /()()()()()()()()()()()()()()()()()()()()
1658     ()()()()()()()()()()()()()()()()()()()()
1659     ()()()()()()()()()()()()()()()()()()()()
1660     ()()()()()()()()()()()()()()()()()()()()
1661     ()()()()()()()()()()()()()()()()()()()()
1662     (.(.))/Ix
1663 ph10 102 XY\O400
1664 nigel 93
1665     /(a*b|(?i:c*(?-i)d))/IS
1666    
1667     /()[ab]xyz/IS
1668    
1669     /(|)[ab]xyz/IS
1670    
1671     /(|c)[ab]xyz/IS
1672    
1673     /(|c?)[ab]xyz/IS
1674    
1675     /(d?|c?)[ab]xyz/IS
1676    
1677     /(d?|c)[ab]xyz/IS
1678    
1679 ph10 161 /^a*b\d/DZ
1680 nigel 93
1681 ph10 161 /^a*+b\d/DZ
1682 nigel 93
1683 ph10 161 /^a*?b\d/DZ
1684 nigel 93
1685 ph10 161 /^a+A\d/DZ
1686 nigel 93 aaaA5
1687     ** Failers
1688 ph10 102 aaaa5
1689 nigel 93
1690 ph10 161 /^a*A\d/IiDZ
1691 nigel 93 aaaA5
1692     aaaa5
1693    
1694     /(a*|b*)[cd]/IS
1695    
1696     /(a+|b*)[cd]/IS
1697    
1698     /(a*|b+)[cd]/IS
1699    
1700     /(a+|b+)[cd]/IS
1701    
1702     /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1703     ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1704     (((
1705     a
1706     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1707     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1708 ph10 102 )))
1709     /Ix
1710 nigel 93 large nest
1711    
1712 ph10 162 /a*\d/BZ
1713 nigel 93
1714 ph10 162 /a*\D/BZ
1715 nigel 93
1716 ph10 162 /0*\d/BZ
1717 nigel 93
1718 ph10 162 /0*\D/BZ
1719 nigel 93
1720 ph10 162 /a*\s/BZ
1721 nigel 93
1722 ph10 162 /a*\S/BZ
1723 nigel 93
1724 ph10 162 / *\s/BZ
1725 nigel 93
1726 ph10 162 / *\S/BZ
1727 nigel 93
1728 ph10 162 /a*\w/BZ
1729 nigel 93
1730 ph10 162 /a*\W/BZ
1731 nigel 93
1732 ph10 162 /=*\w/BZ
1733 nigel 93
1734 ph10 162 /=*\W/BZ
1735 nigel 93
1736 ph10 162 /\d*a/BZ
1737 nigel 93
1738 ph10 162 /\d*2/BZ
1739 nigel 93
1740 ph10 162 /\d*\d/BZ
1741 nigel 93
1742 ph10 162 /\d*\D/BZ
1743 nigel 93
1744 ph10 162 /\d*\s/BZ
1745 nigel 93
1746 ph10 162 /\d*\S/BZ
1747 nigel 93
1748 ph10 162 /\d*\w/BZ
1749 nigel 93
1750 ph10 162 /\d*\W/BZ
1751 nigel 93
1752 ph10 162 /\D*a/BZ
1753 nigel 93
1754 ph10 162 /\D*2/BZ
1755 nigel 93
1756 ph10 162 /\D*\d/BZ
1757 nigel 93
1758 ph10 162 /\D*\D/BZ
1759 nigel 93
1760 ph10 162 /\D*\s/BZ
1761 nigel 93
1762 ph10 162 /\D*\S/BZ
1763 nigel 93
1764 ph10 162 /\D*\w/BZ
1765 nigel 93
1766 ph10 162 /\D*\W/BZ
1767 nigel 93
1768 ph10 162 /\s*a/BZ
1769 nigel 93
1770 ph10 162 /\s*2/BZ
1771 nigel 93
1772 ph10 162 /\s*\d/BZ
1773 nigel 93
1774 ph10 162 /\s*\D/BZ
1775 nigel 93
1776 ph10 162 /\s*\s/BZ
1777 nigel 93
1778 ph10 162 /\s*\S/BZ
1779 nigel 93
1780 ph10 162 /\s*\w/BZ
1781 nigel 93
1782 ph10 162 /\s*\W/BZ
1783 nigel 93
1784 ph10 162 /\S*a/BZ
1785 nigel 93
1786 ph10 162 /\S*2/BZ
1787 nigel 93
1788 ph10 162 /\S*\d/BZ
1789 nigel 93
1790 ph10 162 /\S*\D/BZ
1791 nigel 93
1792 ph10 162 /\S*\s/BZ
1793 nigel 93
1794 ph10 162 /\S*\S/BZ
1795 nigel 93
1796 ph10 162 /\S*\w/BZ
1797 nigel 93
1798 ph10 162 /\S*\W/BZ
1799 nigel 93
1800 ph10 162 /\w*a/BZ
1801 nigel 93
1802 ph10 162 /\w*2/BZ
1803 nigel 93
1804 ph10 162 /\w*\d/BZ
1805 nigel 93
1806 ph10 162 /\w*\D/BZ
1807 nigel 93
1808 ph10 162 /\w*\s/BZ
1809 nigel 93
1810 ph10 162 /\w*\S/BZ
1811 nigel 93
1812 ph10 162 /\w*\w/BZ
1813 nigel 93
1814 ph10 162 /\w*\W/BZ
1815 nigel 93
1816 ph10 162 /\W*a/BZ
1817 nigel 93
1818 ph10 162 /\W*2/BZ
1819 nigel 93
1820 ph10 162 /\W*\d/BZ
1821 nigel 93
1822 ph10 162 /\W*\D/BZ
1823 nigel 93
1824 ph10 162 /\W*\s/BZ
1825 nigel 93
1826 ph10 162 /\W*\S/BZ
1827 nigel 93
1828 ph10 162 /\W*\w/BZ
1829 nigel 93
1830 ph10 162 /\W*\W/BZ
1831 nigel 93
1832 ph10 162 /[^a]+a/BZ
1833 nigel 93
1834 ph10 162 /[^a]+a/BZi
1835 nigel 93
1836 ph10 162 /[^a]+A/BZi
1837 nigel 93
1838 ph10 162 /[^a]+b/BZ
1839 nigel 93
1840 ph10 162 /[^a]+\d/BZ
1841 nigel 93
1842 ph10 162 /a*[^a]/BZ
1843 nigel 93
1844     /(?P<abc>x)(?P<xyz>y)/I
1845     xy\Cabc\Cxyz
1846    
1847     /(?<abc>x)(?'xyz'y)/I
1848     xy\Cabc\Cxyz
1849    
1850     /(?<abc'x)(?'xyz'y)/I
1851    
1852     /(?<abc>x)(?'xyz>y)/I
1853    
1854     /(?P'abc'x)(?P<xyz>y)/I
1855    
1856     /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
1857     bXaX
1858     bXbX
1859     ** Failers
1860 ph10 102 aXaX
1861     aXbX
1862 nigel 93
1863     /^(?P>abc)(?<abcd>xxx)/
1864    
1865     /^(?P>abc)(?<abc>x|y)/
1866     xx
1867     xy
1868     yy
1869 ph10 102 yx
1870 nigel 93
1871     /^(?P>abc)(?P<abc>x|y)/
1872     xx
1873     xy
1874     yy
1875 ph10 102 yx
1876 nigel 93
1877     /^((?(abc)a|b)(?<abc>x|y))+/
1878     bxay
1879 ph10 102 bxby
1880 nigel 93 ** Failers
1881 ph10 102 axby
1882 nigel 93
1883     /^(((?P=abc)|X)(?<abc>x|y))+/
1884     XxXxxx
1885     XxXyyx
1886     XxXyxx
1887     ** Failers
1888 ph10 102 x
1889 nigel 93
1890     /^(?1)(abc)/
1891     abcabc
1892    
1893     /^(?:(?:\1|X)(a|b))+/
1894     Xaaa
1895 ph10 102 Xaba
1896 nigel 93
1897 ph10 162 /^[\E\Qa\E-\Qz\E]+/BZ
1898 ph10 102
1899 ph10 162 /^[a\Q]bc\E]/BZ
1900 ph10 102
1901 ph10 162 /^[a-\Q\E]/BZ
1902 nigel 93
1903 ph10 162 /^(?P>abc)[()](?<abc>)/BZ
1904 nigel 93
1905 ph10 162 /^((?(abc)y)[()](?P<abc>x))+/BZ
1906 nigel 93 (xy)x
1907    
1908 ph10 162 /^(?P>abc)\Q()\E(?<abc>)/BZ
1909 nigel 93
1910 ph10 162 /^(?P>abc)[a\Q(]\E(](?<abc>)/BZ
1911 ph10 102
1912 nigel 93 /^(?P>abc) # this is (a comment)
1913 ph10 162 (?<abc>)/BZx
1914 nigel 93
1915     /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
1916     1221
1917     Satan, oscillate my metallic sonatas!
1918     A man, a plan, a canal: Panama!
1919 ph10 102 Able was I ere I saw Elba.
1920 nigel 93 *** Failers
1921 ph10 102 The quick brown fox
1922    
1923 nigel 93 /(?=(\w+))\1:/I
1924     abcd:
1925    
1926     /(?=(?'abc'\w+))\k<abc>:/I
1927     abcd:
1928    
1929     /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
1930     adaa
1931     ** Failers
1932     addd
1933 ph10 102 adbb
1934 nigel 93
1935     /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/J
1936     bdaa
1937     bdab
1938     ** Failers
1939 ph10 102 bddd
1940 nigel 93
1941     /(?(<bc))/
1942    
1943 ph10 102 /(?(''))/
1944 nigel 93
1945     /(?('R')stuff)/
1946    
1947     /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
1948     abcabc1Xabc2XabcXabcabc
1949    
1950     /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1951     abcabc1Xabc2XabcXabcabc
1952    
1953 ph10 1394 /(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1954 nigel 93
1955     /^(?(DEFINE) abc | xyz ) /x
1956 ph10 102
1957 nigel 93 /(?(DEFINE) abc) xyz/xI
1958    
1959     /(a|)*\d/
1960     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1961     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
1962    
1963     /^a.b/<lf>
1964     a\rb
1965 ph10 102 a\nb\<cr>
1966 ph10 149 a\x85b\<anycrlf>
1967 nigel 93 ** Failers
1968     a\nb
1969     a\nb\<any>
1970 ph10 102 a\rb\<cr>
1971     a\rb\<any>
1972 ph10 149 a\x85b\<any>
1973     a\rb\<anycrlf>
1974 nigel 93
1975     /^abc./mgx<any>
1976 ph10 355 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
1977 nigel 93
1978     /abc.$/mgx<any>
1979 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
1980 nigel 93
1981     /a/<cr><any>
1982    
1983     /a/<any><crlf>
1984    
1985 ph10 247 /^a\Rb/<bsr_unicode>
1986 nigel 93 a\nb
1987     a\rb
1988     a\r\nb
1989     a\x0bb
1990     a\x0cb
1991 ph10 102 a\x85b
1992 nigel 93 ** Failers
1993 ph10 102 a\n\rb
1994 nigel 93
1995 ph10 247 /^a\R*b/<bsr_unicode>
1996 nigel 93 ab
1997     a\nb
1998     a\rb
1999     a\r\nb
2000     a\x0bb
2001     a\x0cb
2002 ph10 102 a\x85b
2003     a\n\rb
2004     a\n\r\x85\x0cb
2005 nigel 93
2006 ph10 247 /^a\R+b/<bsr_unicode>
2007 nigel 93 a\nb
2008     a\rb
2009     a\r\nb
2010     a\x0bb
2011     a\x0cb
2012 ph10 102 a\x85b
2013     a\n\rb
2014     a\n\r\x85\x0cb
2015 nigel 93 ** Failers
2016 ph10 102 ab
2017    
2018 ph10 247 /^a\R{1,3}b/<bsr_unicode>
2019 nigel 93 a\nb
2020     a\n\rb
2021     a\n\r\x85b
2022 ph10 102 a\r\n\r\nb
2023     a\r\n\r\n\r\nb
2024 nigel 93 a\n\r\n\rb
2025 ph10 102 a\n\n\r\nb
2026 nigel 93 ** Failers
2027     a\n\n\n\rb
2028     a\r
2029    
2030 ph10 247 /^a[\R]b/<bsr_unicode>
2031 nigel 93 aRb
2032     ** Failers
2033 ph10 102 a\nb
2034 nigel 93
2035     /(?&abc)X(?<abc>P)/I
2036     abcPXP123
2037    
2038     /(?1)X(?<abc>P)/I
2039     abcPXP123
2040    
2041     /(?:a(?&abc)b)*(?<abc>x)/
2042     123axbaxbaxbx456
2043     123axbaxbaxb456
2044 ph10 102
2045 nigel 93 /(?:a(?&abc)b){1,5}(?<abc>x)/
2046     123axbaxbaxbx456
2047    
2048     /(?:a(?&abc)b){2,5}(?<abc>x)/
2049     123axbaxbaxbx456
2050    
2051     /(?:a(?&abc)b){2,}(?<abc>x)/
2052     123axbaxbaxbx456
2053    
2054     /(abc)(?i:(?1))/
2055     defabcabcxyz
2056     DEFabcABCXYZ
2057    
2058     /(abc)(?:(?i)(?1))/
2059     defabcabcxyz
2060     DEFabcABCXYZ
2061    
2062     /^(a)\g-2/
2063    
2064     /^(a)\g/
2065    
2066     /^(a)\g{0}/
2067    
2068     /^(a)\g{3/
2069    
2070 ph10 1394 /^(a)\g{aa}/
2071 nigel 93
2072     /^a.b/<lf>
2073     a\rb
2074     *** Failers
2075     a\nb
2076    
2077     /.+foo/
2078     afoo
2079 ph10 102 ** Failers
2080     \r\nfoo
2081     \nfoo
2082 nigel 93
2083     /.+foo/<crlf>
2084     afoo
2085 ph10 102 \nfoo
2086     ** Failers
2087     \r\nfoo
2088 nigel 93
2089     /.+foo/<any>
2090     afoo
2091 ph10 102 ** Failers
2092     \nfoo
2093     \r\nfoo
2094 nigel 93
2095     /.+foo/s
2096     afoo
2097 ph10 102 \r\nfoo
2098     \nfoo
2099 ph10 131
2100     /^$/mg<any>
2101     abc\r\rxyz
2102     abc\n\rxyz
2103     ** Failers
2104     abc\r\nxyz
2105 nigel 93
2106 ph10 141 /(?m)^$/<any>g+
2107     abc\r\n\r\n
2108    
2109 ph10 143 /(?m)^$|^\r\n/<any>g+
2110     abc\r\n\r\n
2111    
2112     /(?m)$/<any>g+
2113     abc\r\n\r\n
2114    
2115 ph10 149 /abc.$/mgx<anycrlf>
2116 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
2117 ph10 149
2118 ph10 155 /^X/m
2119     XABC
2120     ** Failers
2121     XABC\B
2122    
2123 ph10 174 /(ab|c)(?-1)/BZ
2124 ph10 166 abc
2125    
2126 ph10 174 /xy(?+1)(abc)/BZ
2127 ph10 166 xyabcabc
2128     ** Failers
2129     xyabc
2130    
2131     /x(?-0)y/
2132    
2133     /x(?-1)y/
2134    
2135     /x(?+0)y/
2136    
2137     /x(?+1)y/
2138    
2139 ph10 174 /^(abc)?(?(-1)X|Y)/BZ
2140 ph10 167 abcX
2141     Y
2142     ** Failers
2143     abcY
2144    
2145 ph10 174 /^((?(+1)X|Y)(abc))+/BZ
2146 ph10 167 YabcXabc
2147     YabcXabcXabc
2148     ** Failers
2149     XabcXabc
2150    
2151 ph10 174 /(?(-1)a)/BZ
2152 ph10 167
2153 ph10 174 /((?(-1)a))/BZ
2154 ph10 167
2155 ph10 174 /((?(-2)a))/BZ
2156 ph10 167
2157 ph10 270 /^(?(+1)X|Y)(.)/BZ
2158     Y!
2159 ph10 167
2160 ph10 171 /(?<A>tom|bon)-\k{A}/
2161     tom-tom
2162     bon-bon
2163     ** Failers
2164     tom-bon
2165    
2166     /\g{A/
2167    
2168 ph10 175 /(?|(abc)|(xyz))/BZ
2169     >abc<
2170     >xyz<
2171    
2172     /(x)(?|(abc)|(xyz))(x)/BZ
2173     xabcx
2174     xxyzx
2175    
2176     /(x)(?|(abc)(pqr)|(xyz))(x)/BZ
2177     xabcpqrx
2178     xxyzx
2179    
2180 ph10 180 /\H++X/BZ
2181     ** Failers
2182     XXXX
2183    
2184     /\H+\hY/BZ
2185     XXXX Y
2186    
2187     /\H+ Y/BZ
2188    
2189     /\h+A/BZ
2190    
2191     /\v*B/BZ
2192    
2193     /\V+\x0a/BZ
2194    
2195     /A+\h/BZ
2196    
2197     / *\H/BZ
2198    
2199     /A*\v/BZ
2200    
2201     /\x0b*\V/BZ
2202    
2203     /\d+\h/BZ
2204    
2205     /\d*\v/BZ
2206    
2207     /S+\h\S+\v/BZ
2208    
2209     /\w{3,}\h\w+\v/BZ
2210    
2211     /\h+\d\h+\w\h+\S\h+\H/BZ
2212    
2213     /\v+\d\v+\w\v+\S\v+\V/BZ
2214    
2215     /\H+\h\H+\d/BZ
2216    
2217     /\V+\v\V+\w/BZ
2218    
2219 ph10 197 /\( (?: [^()]* | (?R) )* \)/x
2220 ph10 666 \J1024(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)
2221 ph10 197
2222 ph10 205 /[\E]AAA/
2223    
2224     /[\Q\E]AAA/
2225    
2226     /[^\E]AAA/
2227    
2228     /[^\Q\E]AAA/
2229    
2230     /[\E^]AAA/
2231    
2232     /[\Q\E^]AAA/
2233    
2234 ph10 210 /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ
2235    
2236     /^a+(*FAIL)/C
2237     aaaaaa
2238    
2239     /a+b?c+(*FAIL)/C
2240     aaabccc
2241    
2242     /a+b?(*PRUNE)c+(*FAIL)/C
2243     aaabccc
2244    
2245     /a+b?(*COMMIT)c+(*FAIL)/C
2246     aaabccc
2247    
2248     /a+b?(*SKIP)c+(*FAIL)/C
2249     aaabcccaaabccc
2250    
2251     /a+b?(*THEN)c+(*FAIL)/C
2252     aaabccc
2253    
2254     /a(*MARK)b/
2255    
2256 ph10 213 /(?i:A{1,}\6666666666)/
2257    
2258     /\g6666666666/
2259    
2260 ph10 640 /[\g6666666666]/BZ
2261 ph10 213
2262 ph10 215 /(?1)\c[/
2263    
2264 ph10 226 /.+A/<crlf>
2265     \r\nA
2266    
2267     /\nA/<crlf>
2268     \r\nA
2269    
2270     /[\r\n]A/<crlf>
2271     \r\nA
2272    
2273     /(\r|\n)A/<crlf>
2274     \r\nA
2275    
2276 ph10 227 /a(*CR)b/
2277    
2278     /(*CR)a.b/
2279     a\nb
2280     ** Failers
2281     a\rb
2282    
2283     /(*CR)a.b/<lf>
2284     a\nb
2285     ** Failers
2286     a\rb
2287    
2288     /(*LF)a.b/<CRLF>
2289     a\rb
2290     ** Failers
2291     a\nb
2292    
2293     /(*CRLF)a.b/
2294     a\rb
2295     a\nb
2296     ** Failers
2297     a\r\nb
2298    
2299     /(*ANYCRLF)a.b/<CR>
2300     ** Failers
2301     a\rb
2302     a\nb
2303     a\r\nb
2304    
2305     /(*ANY)a.b/<cr>
2306     ** Failers
2307     a\rb
2308     a\nb
2309     a\r\nb
2310     a\x85b
2311 ph10 566
2312     /(*ANY).*/g
2313     abc\r\ndef
2314 ph10 227
2315 ph10 566 /(*ANYCRLF).*/g
2316     abc\r\ndef
2317    
2318     /(*CRLF).*/g
2319     abc\r\ndef
2320    
2321 ph10 231 /a\Rb/I<bsr_anycrlf>
2322     a\rb
2323     a\nb
2324     a\r\nb
2325     ** Failers
2326     a\x85b
2327     a\x0bb
2328    
2329     /a\Rb/I<bsr_unicode>
2330     a\rb
2331     a\nb
2332     a\r\nb
2333     a\x85b
2334     a\x0bb
2335     ** Failers
2336     a\x85b\<bsr_anycrlf>
2337     a\x0bb\<bsr_anycrlf>
2338    
2339     /a\R?b/I<bsr_anycrlf>
2340     a\rb
2341     a\nb
2342     a\r\nb
2343     ** Failers
2344     a\x85b
2345     a\x0bb
2346    
2347     /a\R?b/I<bsr_unicode>
2348     a\rb
2349     a\nb
2350     a\r\nb
2351     a\x85b
2352     a\x0bb
2353     ** Failers
2354     a\x85b\<bsr_anycrlf>
2355     a\x0bb\<bsr_anycrlf>
2356    
2357     /a\R{2,4}b/I<bsr_anycrlf>
2358     a\r\n\nb
2359     a\n\r\rb
2360     a\r\n\r\n\r\n\r\nb
2361     ** Failers
2362     a\x85\85b
2363     a\x0b\0bb
2364    
2365     /a\R{2,4}b/I<bsr_unicode>
2366     a\r\rb
2367     a\n\n\nb
2368     a\r\n\n\r\rb
2369     a\x85\85b
2370     a\x0b\0bb
2371     ** Failers
2372     a\r\r\r\r\rb
2373     a\x85\85b\<bsr_anycrlf>
2374     a\x0b\0bb\<bsr_anycrlf>
2375    
2376     /(*BSR_ANYCRLF)a\Rb/I
2377     a\nb
2378     a\rb
2379    
2380     /(*BSR_UNICODE)a\Rb/I
2381     a\x85b
2382    
2383     /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
2384     a\nb
2385     a\rb
2386    
2387     /(*CRLF)(*BSR_UNICODE)a\Rb/I
2388     a\x85b
2389    
2390     /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
2391    
2392 ph10 268 /(?<a>)(?&)/
2393    
2394     /(?<abc>)(?&a)/
2395    
2396     /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
2397    
2398 ph10 269 /(?+-a)/
2399    
2400     /(?-+a)/
2401    
2402 ph10 271 /(?(-1))/
2403    
2404     /(?(+10))/
2405    
2406     /(?(10))/
2407    
2408     /(?(+2))()()/
2409    
2410     /(?(2))()()/
2411    
2412 ph10 272 /\k''/
2413    
2414     /\k<>/
2415    
2416     /\k{}/
2417    
2418 ph10 629 /\k/
2419    
2420     /\kabc/
2421    
2422 ph10 272 /(?P=)/
2423    
2424     /(?P>)/
2425    
2426 ph10 282 /(?!\w)(?R)/
2427    
2428     /(?=\w)(?R)/
2429    
2430     /(?<!\w)(?R)/
2431    
2432     /(?<=\w)(?R)/
2433    
2434 ph10 295 /[[:foo:]]/
2435    
2436     /[[:1234:]]/
2437    
2438     /[[:f\oo:]]/
2439    
2440     /[[: :]]/
2441    
2442     /[[:...:]]/
2443    
2444     /[[:l\ower:]]/
2445    
2446     /[[:abc\:]]/
2447    
2448     /[abc[:x\]pqr:]]/
2449    
2450     /[[:a\dz:]]/
2451    
2452 ph10 333 /(^(a|b\g<-1'c))/
2453    
2454 ph10 335 /^(?+1)(?<a>x|y){0}z/
2455     xzxx
2456     yzyy
2457     ** Failers
2458     xxz
2459    
2460 ph10 336 /(\3)(\1)(a)/
2461     cat
2462    
2463     /(\3)(\1)(a)/<JS>
2464     cat
2465    
2466     /TA]/
2467     The ACTA] comes
2468    
2469     /TA]/<JS>
2470     The ACTA] comes
2471    
2472 ph10 340 /(?2)[]a()b](abc)/
2473     abcbabc
2474    
2475     /(?2)[^]a()b](abc)/
2476     abcbabc
2477    
2478     /(?1)[]a()b](abc)/
2479     abcbabc
2480     ** Failers
2481     abcXabc
2482    
2483     /(?1)[^]a()b](abc)/
2484     abcXabc
2485     ** Failers
2486     abcbabc
2487    
2488     /(?2)[]a()b](abc)(xyz)/
2489     xyzbabcxyz
2490    
2491     /(?&N)[]a(?<N>)](?<M>abc)/
2492     abc<abc
2493    
2494     /(?&N)[]a(?<N>)](abc)/
2495     abc<abc
2496    
2497 ph10 341 /a[]b/
2498    
2499     /a[^]b/
2500    
2501     /a[]b/<JS>
2502     ** Failers
2503     ab
2504    
2505     /a[]+b/<JS>
2506     ** Failers
2507     ab
2508    
2509     /a[]*+b/<JS>
2510     ** Failers
2511     ab
2512    
2513     /a[^]b/<JS>
2514     aXb
2515     a\nb
2516     ** Failers
2517     ab
2518    
2519     /a[^]+b/<JS>
2520     aXb
2521     a\nX\nXb
2522     ** Failers
2523     ab
2524    
2525 ph10 1393 /a(?!)b/BZ
2526 ph10 341
2527 ph10 1393 /(?!)?a/BZ
2528     ab
2529    
2530 ph10 341 /a(*FAIL)+b/
2531    
2532 ph10 353 /(abc|pqr|123){0}[xyz]/SI
2533    
2534 ph10 381 /(?(?=.*b)b|^)/CI
2535     adc
2536     abc
2537    
2538     /(?(?=b).*b|^d)/I
2539    
2540     /(?(?=.*b).*b|^d)/I
2541    
2542 ph10 389 /xyz/C
2543     xyz
2544     abcxyz
2545     abcxyz\Y
2546     ** Failers
2547     abc
2548     abc\Y
2549     abcxypqr
2550     abcxypqr\Y
2551 ph10 576
2552     /(*NO_START_OPT)xyz/C
2553 ph10 1395 abcxyz
2554    
2555     /(*NO_AUTO_POSSESS)a+b/BZ
2556 ph10 389
2557 ph10 576 /xyz/CY
2558     abcxyz
2559    
2560 ph10 399 /^"((?(?=[a])[^"])|b)*"$/C
2561     "ab"
2562    
2563     /^"((?(?=[a])[^"])|b)*"$/
2564     "ab"
2565    
2566 ph10 408 /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
2567     XYabcdY
2568    
2569     /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
2570     XYabcdY
2571    
2572 ph10 426 /Xa{2,4}b/
2573     X\P
2574     Xa\P
2575     Xaa\P
2576     Xaaa\P
2577     Xaaaa\P
2578    
2579     /Xa{2,4}?b/
2580     X\P
2581     Xa\P
2582     Xaa\P
2583     Xaaa\P
2584     Xaaaa\P
2585    
2586     /Xa{2,4}+b/
2587     X\P
2588     Xa\P
2589     Xaa\P
2590     Xaaa\P
2591     Xaaaa\P
2592    
2593     /X\d{2,4}b/
2594     X\P
2595     X3\P
2596     X33\P
2597     X333\P
2598     X3333\P
2599    
2600     /X\d{2,4}?b/
2601     X\P
2602     X3\P
2603     X33\P
2604     X333\P
2605     X3333\P
2606    
2607     /X\d{2,4}+b/
2608     X\P
2609     X3\P
2610     X33\P
2611     X333\P
2612     X3333\P
2613    
2614     /X\D{2,4}b/
2615     X\P
2616     Xa\P
2617     Xaa\P
2618     Xaaa\P
2619     Xaaaa\P
2620    
2621     /X\D{2,4}?b/
2622     X\P
2623     Xa\P
2624     Xaa\P
2625     Xaaa\P
2626     Xaaaa\P
2627    
2628     /X\D{2,4}+b/
2629     X\P
2630     Xa\P
2631     Xaa\P
2632     Xaaa\P
2633     Xaaaa\P
2634    
2635     /X[abc]{2,4}b/
2636     X\P
2637     Xa\P
2638     Xaa\P
2639     Xaaa\P
2640     Xaaaa\P
2641    
2642     /X[abc]{2,4}?b/
2643     X\P
2644     Xa\P
2645     Xaa\P
2646     Xaaa\P
2647     Xaaaa\P
2648    
2649     /X[abc]{2,4}+b/
2650     X\P
2651     Xa\P
2652     Xaa\P
2653     Xaaa\P
2654     Xaaaa\P
2655    
2656     /X[^a]{2,4}b/
2657     X\P
2658     Xz\P
2659     Xzz\P
2660     Xzzz\P
2661     Xzzzz\P
2662    
2663     /X[^a]{2,4}?b/
2664     X\P
2665     Xz\P
2666     Xzz\P
2667     Xzzz\P
2668     Xzzzz\P
2669    
2670     /X[^a]{2,4}+b/
2671     X\P
2672     Xz\P
2673     Xzz\P
2674     Xzzz\P
2675     Xzzzz\P
2676    
2677     /(Y)X\1{2,4}b/
2678     YX\P
2679     YXY\P
2680     YXYY\P
2681     YXYYY\P
2682     YXYYYY\P
2683    
2684     /(Y)X\1{2,4}?b/
2685     YX\P
2686     YXY\P
2687     YXYY\P
2688     YXYYY\P
2689     YXYYYY\P
2690    
2691     /(Y)X\1{2,4}+b/
2692     YX\P
2693     YXY\P
2694     YXYY\P
2695     YXYYY\P
2696     YXYYYY\P
2697    
2698     /\++\KZ|\d+X|9+Y/
2699     ++++123999\P
2700     ++++123999Y\P
2701     ++++Z1234\P
2702    
2703     /Z(*F)/
2704     Z\P
2705     ZA\P
2706    
2707     /Z(?!)/
2708     Z\P
2709     ZA\P
2710    
2711 ph10 427 /dog(sbody)?/
2712     dogs\P
2713     dogs\P\P
2714    
2715 ph10 428 /dog(sbody)??/
2716     dogs\P
2717     dogs\P\P
2718    
2719 ph10 427 /dog|dogsbody/
2720     dogs\P
2721     dogs\P\P
2722    
2723 ph10 428 /dogsbody|dog/
2724     dogs\P
2725     dogs\P\P
2726    
2727     /\bthe cat\b/
2728     the cat\P
2729     the cat\P\P
2730    
2731     /abc/
2732     abc\P
2733     abc\P\P
2734 ph10 432
2735 ph10 435 /abc\K123/
2736     xyzabc123pqr
2737     xyzabc12\P
2738     xyzabc12\P\P
2739    
2740     /(?<=abc)123/
2741     xyzabc123pqr
2742     xyzabc12\P
2743     xyzabc12\P\P
2744    
2745     /\babc\b/
2746     +++abc+++
2747     +++ab\P
2748     +++ab\P\P
2749    
2750 ph10 438 /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
2751    
2752     /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
2753    
2754 ph10 449 /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
2755    
2756 ph10 442 /abc\K/+
2757     abcdef
2758     abcdef\N\N
2759     xyzabcdef\N\N
2760     ** Failers
2761     abcdef\N
2762     xyzabcdef\N
2763    
2764     /^(?:(?=abc)|abc\K)/+
2765     abcdef
2766     abcdef\N\N
2767     ** Failers
2768     abcdef\N
2769    
2770     /a?b?/+
2771     xyz
2772     xyzabc
2773     xyzabc\N
2774     xyzabc\N\N
2775     xyz\N\N
2776     ** Failers
2777     xyz\N
2778    
2779     /^a?b?/+
2780     xyz
2781     xyzabc
2782     ** Failers
2783     xyzabc\N
2784     xyzabc\N\N
2785     xyz\N\N
2786     xyz\N
2787    
2788 ph10 448 /^(?<name>a|b\g<name>c)/
2789     aaaa
2790     bacxxx
2791     bbaccxxx
2792     bbbacccxx
2793    
2794     /^(?<name>a|b\g'name'c)/
2795     aaaa
2796     bacxxx
2797     bbaccxxx
2798     bbbacccxx
2799    
2800     /^(a|b\g<1>c)/
2801     aaaa
2802     bacxxx
2803     bbaccxxx
2804     bbbacccxx
2805    
2806     /^(a|b\g'1'c)/
2807     aaaa
2808     bacxxx
2809     bbaccxxx
2810     bbbacccxx
2811    
2812     /^(a|b\g'-1'c)/
2813     aaaa
2814     bacxxx
2815     bbaccxxx
2816     bbbacccxx
2817    
2818     /(^(a|b\g<-1>c))/
2819     aaaa
2820     bacxxx
2821     bbaccxxx
2822     bbbacccxx
2823    
2824     /(?-i:\g<name>)(?i:(?<name>a))/
2825     XaaX
2826     XAAX
2827    
2828     /(?i:\g<name>)(?-i:(?<name>a))/
2829     XaaX
2830     ** Failers
2831     XAAX
2832    
2833     /(?-i:\g<+1>)(?i:(a))/
2834     XaaX
2835     XAAX
2836    
2837     /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
2838    
2839     /(?<n>a|b|c)\g<n>*/
2840     abc
2841     accccbbb
2842    
2843     /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2844     XYabcdY
2845    
2846 ph10 454 /(?<=b(?1)|zzz)(a)/
2847     xbaax
2848     xzzzax
2849    
2850     /(a)(?<=b\1)/
2851    
2852     /(a)(?<=b+(?1))/
2853    
2854     /(a+)(?<=b(?1))/
2855    
2856     /(a(?<=b(?1)))/
2857    
2858     /(?<=b(?1))xyz/
2859    
2860     /(?<=b(?1))xyz(b+)pqrstuvew/
2861    
2862 ph10 455 /(a|bc)\1/SI
2863    
2864     /(a|bc)\1{2,3}/SI
2865    
2866     /(a|bc)(?1)/SI
2867    
2868     /(a|b\1)(a|b\1)/SI
2869    
2870     /(a|b\1){2}/SI
2871    
2872     /(a|bbbb\1)(a|bbbb\1)/SI
2873    
2874     /(a|bbbb\1){2}/SI
2875    
2876     /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/SI
2877    
2878     /<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS
2879    
2880     "(?>.*/)foo"SI
2881    
2882     /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
2883    
2884     /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
2885    
2886     /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
2887    
2888     /<a[\s]+href[\s]*=[\s]* # find <a href=
2889     ([\"\'])? # find single or double quote
2890     (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
2891     # quote, otherwise match up to next space
2892     /isxSI
2893    
2894     /^(?!:) # colon disallowed at start
2895     (?: # start of item
2896     (?: [0-9a-f]{1,4} | # 1-4 hex digits or
2897     (?(1)0 | () ) ) # if null previously matched, fail; else null
2898     : # followed by colon
2899     ){1,7} # end item; 1-7 of them required
2900     [0-9a-f]{1,4} $ # final hex number at end of string
2901     (?(1)|.) # check that there was an empty component
2902     /xiIS
2903    
2904 ph10 457 /(?|(?<a>A)|(?<a>B))/I
2905     AB\Ca
2906     BA\Ca
2907    
2908     /(?|(?<a>A)|(?<b>B))/
2909    
2910 ph10 459 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
2911     b(?<quote> (?<apostrophe>')|(?<realquote>")) )
2912     (?('quote')[a-z]+|[0-9]+)/JIx
2913     a"aaaaa
2914     b"aaaaa
2915     ** Failers
2916     b"11111
2917     a"11111
2918    
2919 ph10 461 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
2920 ph10 459 abcdX
2921     eX
2922     ** Failers
2923     abcdY
2924     ey
2925    
2926 ph10 461 /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/JDZx
2927 ph10 459 abcdd
2928     ** Failers
2929     abcdde
2930    
2931 ph10 462 /abcd*/
2932     xxxxabcd\P
2933     xxxxabcd\P\P
2934    
2935     /abcd*/i
2936     xxxxabcd\P
2937     xxxxabcd\P\P
2938     XXXXABCD\P
2939     XXXXABCD\P\P
2940    
2941     /abc\d*/
2942     xxxxabc1\P
2943     xxxxabc1\P\P
2944    
2945     /(a)bc\1*/
2946     xxxxabca\P
2947     xxxxabca\P\P
2948    
2949     /abc[de]*/
2950     xxxxabcde\P
2951     xxxxabcde\P\P
2952    
2953 ph10 1299 /-- This is not in the Perl-compatible test because Perl seems currently to be
2954 ph10 559 broken and not behaving as specified in that it *does* bumpalong after
2955     hitting (*COMMIT). --/
2956 ph10 464
2957     /(?1)(A(*COMMIT)|B)D/
2958     ABD
2959     XABD
2960     BAD
2961     ABXABD
2962     ** Failers
2963     ABX
2964     BAXBAD
2965    
2966 ph10 467 /(\3)(\1)(a)/<JS>
2967     cat
2968    
2969     /(\3)(\1)(a)/SI<JS>
2970     cat
2971    
2972     /(\3)(\1)(a)/SI
2973     cat
2974    
2975 ph10 471 /i(?(DEFINE)(?<s>a))/SI
2976     i
2977    
2978     /()i(?(1)a)/SI
2979     ia
2980    
2981 ph10 472 /(?i)a(?-i)b|c/BZ
2982     XabX
2983     XAbX
2984     CcC
2985     ** Failers
2986     XABX
2987    
2988     /(?i)a(?s)b|c/BZ
2989    
2990     /(?i)a(?s-i)b|c/BZ
2991    
2992 ph10 488 /^(ab(c\1)d|x){2}$/BZ
2993     xabcxd
2994 ph10 496
2995     /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
2996 ph10 488
2997 ph10 496 /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
2998    
2999 ph10 1299 / -- This one is here because Perl gives the match as "b" rather than "ab". I
3000 ph10 500 believe this to be a Perl bug. --/
3001    
3002     /(?>a\Kb)z|(ab)/
3003     ab
3004    
3005 ph10 504 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3006    
3007 ph10 510 /abc(*MARK:)pqr/
3008    
3009     /abc(*:)pqr/
3010    
3011     /abc(*FAIL:123)xyz/
3012    
3013     /--- This should, and does, fail. In Perl, it does not, which I think is a
3014     bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3015    
3016     /A(*COMMIT)B/+K
3017     ACABX
3018    
3019 ph10 1299 /--- These should be different, but in Perl they are not, which I think
3020 ph10 510 is a bug in Perl. ---/
3021    
3022     /A(*THEN)B|A(*THEN)C/K
3023     AC
3024    
3025     /A(*PRUNE)B|A(*PRUNE)C/K
3026     AC
3027    
3028 ph10 836 /--- Mark names can be duplicated. Perl doesn't give a mark for this one,
3029     though PCRE does. ---/
3030 ph10 510
3031     /^A(*:A)B|^X(*:A)Y/K
3032     ** Failers
3033     XAQQ
3034    
3035     /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3036     optimizations defeat this. So does the PCRE optimization unless we disable it
3037     with \Y. ---/
3038    
3039     /(*COMMIT)ABC/
3040     ABCDEFG
3041     ** Failers
3042     DEFGABC\Y
3043    
3044     /^(ab (c+(*THEN)cd) | xyz)/x
3045     abcccd
3046    
3047     /^(ab (c+(*PRUNE)cd) | xyz)/x
3048     abcccd
3049    
3050     /^(ab (c+(*FAIL)cd) | xyz)/x
3051     abcccd
3052 ph10 511
3053 ph10 1299 /--- Perl gets some of these wrong ---/
3054 ph10 510
3055 ph10 511 /(?>.(*ACCEPT))*?5/
3056     abcde
3057    
3058     /(.(*ACCEPT))*?5/
3059     abcde
3060    
3061     /(.(*ACCEPT))5/
3062     abcde
3063    
3064     /(.(*ACCEPT))*5/
3065     abcde
3066    
3067 ph10 514 /A\NB./BZ
3068 ph10 550 ACBD
3069     *** Failers
3070     A\nB
3071     ACB\n
3072 ph10 514
3073     /A\NB./sBZ
3074 ph10 550 ACBD
3075     ACB\n
3076     *** Failers
3077     A\nB
3078 ph10 514
3079     /A\NB/<crlf>
3080 ph10 550 A\nB
3081     A\rB
3082     ** Failers
3083     A\r\nB
3084 ph10 514
3085 ph10 528 /\R+b/BZ
3086    
3087     /\R+\n/BZ
3088    
3089     /\R+\d/BZ
3090    
3091     /\d*\R/BZ
3092    
3093     /\s*\R/BZ
3094 ph10 961 \x20\x0a
3095     \x20\x0d
3096     \x20\x0d\x0a
3097 ph10 528
3098 ph10 961 /\S*\R/BZ
3099     a\x0a
3100    
3101     /X\h*\R/BZ
3102     X\x20\x0a
3103    
3104     /X\H*\R/BZ
3105     X\x0d\x0a
3106    
3107     /X\H+\R/BZ
3108     X\x0d\x0a
3109    
3110     /X\H++\R/BZ
3111     X\x0d\x0a
3112    
3113 ph10 553 /(?<=abc)def/
3114     abc\P\P
3115    
3116     /abc$/
3117     abc
3118     abc\P
3119     abc\P\P
3120    
3121     /abc$/m
3122     abc
3123     abc\n
3124     abc\P\P
3125     abc\n\P\P
3126     abc\P
3127     abc\n\P
3128    
3129     /abc\z/
3130     abc
3131     abc\P
3132     abc\P\P
3133    
3134     /abc\Z/
3135     abc
3136     abc\P
3137     abc\P\P
3138    
3139     /abc\b/
3140     abc
3141     abc\P
3142     abc\P\P
3143    
3144     /abc\B/
3145     abc
3146     abc\P
3147     abc\P\P
3148    
3149 ph10 567 /.+/
3150     abc\>0
3151     abc\>1
3152     abc\>2
3153     abc\>3
3154     abc\>4
3155     abc\>-4
3156    
3157 ph10 574 /^\cģ/
3158    
3159 ph10 578 /(?P<abn>(?P=abn)xxx)/BZ
3160    
3161     /(a\1z)/BZ
3162    
3163     /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
3164    
3165     /(?P<abn>(?P=axn)xxx)/BZ
3166    
3167     /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
3168    
3169 ph10 600 /-- These tests are here because Perl gets the first one wrong. --/
3170    
3171     /(\R*)(.)/s
3172     \r\n
3173     \r\r\n\n\r
3174     \r\r\n\n\r\n
3175    
3176     /(\R)*(.)/s
3177     \r\n
3178     \r\r\n\n\r
3179     \r\r\n\n\r\n
3180    
3181     /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
3182     \r\n
3183     \r\r\n\n\r
3184     \r\r\n\n\r\n
3185    
3186     /-- --/
3187    
3188 ph10 602 /^abc$/BZ
3189    
3190     /^abc$/BZm
3191    
3192 ph10 604 /^(a)*+(\w)/S
3193     aaaaX
3194     ** Failers
3195     aaaa
3196    
3197     /^(?:a)*+(\w)/S
3198     aaaaX
3199     ** Failers
3200     aaaa
3201    
3202     /(a)++1234/SDZ
3203    
3204     /([abc])++1234/SI
3205    
3206     /(?<=(abc)+)X/
3207    
3208     /(^ab)/I
3209    
3210     /(^ab)++/I
3211    
3212     /(^ab|^)+/I
3213    
3214     /(^ab|^)++/I
3215    
3216     /(?:^ab)/I
3217    
3218     /(?:^ab)++/I
3219    
3220     /(?:^ab|^)+/I
3221    
3222     /(?:^ab|^)++/I
3223    
3224     /(.*ab)/I
3225    
3226     /(.*ab)++/I
3227    
3228     /(.*ab|.*)+/I
3229    
3230     /(.*ab|.*)++/I
3231    
3232     /(?:.*ab)/I
3233    
3234     /(?:.*ab)++/I
3235    
3236     /(?:.*ab|.*)+/I
3237    
3238     /(?:.*ab|.*)++/I
3239    
3240     /(?=a)[bcd]/I
3241    
3242     /((?=a))[bcd]/I
3243    
3244     /((?=a))+[bcd]/I
3245    
3246     /((?=a))++[bcd]/I
3247    
3248     /(?=a+)[bcd]/iI
3249    
3250     /(?=a+?)[bcd]/iI
3251    
3252     /(?=a++)[bcd]/iI
3253    
3254     /(?=a{3})[bcd]/iI
3255    
3256     /(abc)\1+/S
3257    
3258 ph10 608 /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
3259    
3260     /(?1)(?:(b(*ACCEPT))){0}/
3261     b
3262    
3263     /(?1)(?:(b(*ACCEPT))){0}c/
3264     bc
3265     ** Failers
3266     b
3267    
3268     /(?1)(?:((*ACCEPT))){0}c/
3269     c
3270     c\N
3271    
3272 ph10 609 /^.*?(?(?=a)a|b(*THEN)c)/
3273     ba
3274    
3275     /^.*?(?(?=a)a|bc)/
3276     ba
3277    
3278 ph10 699 /^.*?(?(?=a)a(*THEN)b|c)/
3279     ac
3280    
3281     /^.*?(?(?=a)a(*THEN)b)c/
3282     ac
3283    
3284     /^.*?(a(*THEN)b)c/
3285     aabc
3286 ph10 713
3287     /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
3288     aabc
3289 ph10 699
3290     /^.*?(a(*THEN)b|z)c/
3291     aabc
3292    
3293     /^.*?(z|a(*THEN)b)c/
3294     aabc
3295    
3296 ph10 608 /-- --/
3297    
3298 ph10 612 /-- These studied versions are here because they are not Perl-compatible; the
3299     studying means the mark is not seen. --/
3300    
3301     /(*MARK:A)(*SKIP:B)(C|X)/KS
3302     C
3303     D
3304    
3305     /(*:A)A+(*SKIP:A)(B|Z)/KS
3306     AAAC
3307    
3308     /-- --/
3309    
3310 ph10 613 "(?=a*(*ACCEPT)b)c"
3311     c
3312     c\N
3313    
3314     /(?1)c(?(DEFINE)((*ACCEPT)b))/
3315     c
3316     c\N
3317    
3318     /(?>(*ACCEPT)b)c/
3319     c
3320     c\N
3321    
3322 ph10 618 /(?:(?>(a)))+a%/++
3323     %aa%
3324    
3325 ph10 666 /(a)b|ac/++SS
3326 ph10 618 ac\O3
3327 ph10 666
3328     /(a)(b)x|abc/++
3329     abc\O6
3330 ph10 618
3331 ph10 666 /(a)bc|(a)(b)\2/
3332     \O3abc
3333     \O4abc
3334    
3335 ph10 620 /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
3336    
3337     /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
3338    
3339     /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
3340    
3341     /(abc)(?1)/SI
3342    
3343 ph10 621 /^(?>a)++/
3344     aa\M
3345     aaaaaaaaa\M
3346    
3347     /(a)(?1)++/
3348     aa\M
3349     aaaaaaaaa\M
3350    
3351 ph10 666 /(?:(foo)|(bar)|(baz))X/SS=
3352 ph10 626 bazfooX
3353     foobazbarX
3354     barfooX
3355     bazX
3356     foobarbazX
3357     bazfooX\O0
3358     bazfooX\O2
3359     bazfooX\O4
3360     bazfooX\O6
3361     bazfooX\O8
3362     bazfooX\O10
3363    
3364 ph10 637 /(?=abc){3}abc/BZ
3365    
3366     /(?=abc)+abc/BZ
3367    
3368     /(?=abc)++abc/BZ
3369    
3370     /(?=abc){0}xyz/BZ
3371    
3372     /(?=(a))?./BZ
3373    
3374     /(?=(a))??./BZ
3375    
3376     /^(?=(a)){0}b(?1)/BZ
3377    
3378     /(?(DEFINE)(a))?b(?1)/BZ
3379    
3380     /^(?=(?1))?[az]([abc])d/BZ
3381    
3382     /^(?!a){0}\w+/BZ
3383    
3384     /(?<=(abc))?xyz/BZ
3385    
3386 ph10 666 /[:a[:abc]b:]/BZ
3387 ph10 640
3388 ph10 666 /((?2))((?1))/SS
3389 ph10 642 abc
3390    
3391 zherczeg 741 /((?(R2)a+|(?1)b))/SS
3392 ph10 642 aaaabcde
3393    
3394 zherczeg 741 /(?(R)a*(?1)|((?R))b)/SS
3395 ph10 642 aaaabcde
3396    
3397     /(a+|(?R)b)/
3398    
3399 ph10 647 /^(a(*:A)(d|e(*:B))z|aeq)/C
3400     adz
3401     aez
3402     aeqwerty
3403    
3404 ph10 648 /.(*F)/
3405     \P\Pabc
3406    
3407 ph10 657 /\btype\b\W*?\btext\b\W*?\bjavascript\b/IS
3408    
3409     /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
3410    
3411 ph10 1286 /a(*SKIP)c|b(*ACCEPT)|/+S!I
3412 ph10 697 a
3413    
3414     /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI
3415     ax
3416    
3417     'a*(*ACCEPT)b'+
3418     \N\N
3419     abc\N\N
3420     bbb\N\N
3421    
3422 ph10 701 /(*ACCEPT)a/+I
3423     bax
3424    
3425     /z(*ACCEPT)a/+I
3426     baxzbx
3427    
3428 ph10 702 /a(?:.)*?a/ims
3429     \Mabbbbbbbbbbbbbbbbbbbbba
3430 ph10 716
3431     /a(?:.(*THEN))*?a/ims
3432     \Mabbbbbbbbbbbbbbbbbbbbba
3433 ph10 702
3434 ph10 716 /a(?:.(*THEN:ABC))*?a/ims
3435     \Mabbbbbbbbbbbbbbbbbbbbba
3436    
3437 ph10 725 /^(?>a+)(?>(z+))\w/BZ
3438     aaaazzzzb
3439     ** Failers
3440     aazz
3441    
3442     /(.)(\1|a(?2))/
3443     bab
3444    
3445     /\1|(.)(?R)\1/
3446     cbbbc
3447    
3448     /(.)((?(1)c|a)|a(?2))/
3449     baa
3450    
3451     /(?P<abn>(?P=abn)xxx)/BZ
3452    
3453     /(a\1z)/BZ
3454    
3455     /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
3456     \Maabbccddee
3457    
3458     /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
3459     \Maabbccddee
3460    
3461     /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
3462     \Maabbccddee
3463    
3464 zherczeg 744 /^a\x41z/<JS>
3465     aAz
3466     *** Failers
3467     ax41z
3468    
3469     /^a[m\x41]z/<JS>
3470     aAz
3471    
3472     /^a\x1z/<JS>
3473     ax1z
3474    
3475     /^a\u0041z/<JS>
3476     aAz
3477     *** Failers
3478     au0041z
3479    
3480     /^a[m\u0041]z/<JS>
3481     aAz
3482    
3483     /^a\u041z/<JS>
3484     au041z
3485     *** Failers
3486     aAz
3487    
3488     /^a\U0041z/<JS>
3489     aU0041z
3490     *** Failers
3491     aAz
3492    
3493 ph10 749 /(?(?=c)c|d)++Y/BZ
3494    
3495     /(?(?=c)c|d)*+Y/BZ
3496    
3497 ph10 836 /a[\NB]c/
3498     aNc
3499    
3500     /a[B-\Nc]/
3501 ph10 758
3502 ph10 1392 /a[B\Nc]/
3503    
3504 ph10 836 /(a)(?2){0,1999}?(b)/
3505    
3506     /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
3507    
3508     /--- This test, with something more complicated than individual letters, causes
3509     different behaviour in Perl. Perhaps it disables some optimization; no tag is
3510     passed back for the failures, whereas in PCRE there is a tag. ---/
3511    
3512     /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
3513     AABC
3514     XXYZ
3515     ** Failers
3516     XAQQ
3517     XAQQXZZ
3518     AXQQQ
3519     AXXQQQ
3520    
3521     /-- Perl doesn't give marks for these, though it does if the alternatives are
3522     replaced by single letters. --/
3523    
3524     /(b|q)(*:m)f|a(*:n)w/K
3525     aw
3526     ** Failers
3527     abc
3528    
3529     /(q|b)(*:m)f|a(*:n)w/K
3530     aw
3531     ** Failers
3532     abc
3533    
3534     /-- After a partial match, the behaviour is as for a failure. --/
3535    
3536     /^a(*:X)bcde/K
3537     abc\P
3538 ph10 882
3539     /-- These are here because Perl doesn't return a mark, except for the first --/
3540 ph10 836
3541 ph10 882 /(?=(*:x))(q|)/K+
3542     abc
3543    
3544     /(?=(*:x))((*:y)q|)/K+
3545     abc
3546    
3547     /(?=(*:x))(?:(*:y)q|)/K+
3548     abc
3549    
3550     /(?=(*:x))(?>(*:y)q|)/K+
3551     abc
3552    
3553 ph10 888 /(?=a(*:x))(?!a(*:y)c)/K+
3554     ab
3555    
3556     /(?=a(*:x))(?=a(*:y)c|)/K+
3557     ab
3558    
3559 zherczeg 915 /(..)\1/
3560     ab\P
3561     aba\P
3562     abab\P
3563    
3564     /(..)\1/i
3565     ab\P
3566     abA\P
3567     aBAb\P
3568    
3569     /(..)\1{2,}/
3570     ab\P
3571     aba\P
3572     abab\P
3573     ababa\P
3574     ababab\P
3575     ababab\P\P
3576     abababa\P
3577     abababa\P\P
3578    
3579     /(..)\1{2,}/i
3580     ab\P
3581     aBa\P
3582     aBAb\P
3583     AbaBA\P
3584     abABAb\P
3585     aBAbaB\P\P
3586     abABabA\P
3587     abaBABa\P\P
3588    
3589     /(..)\1{2,}?x/i
3590     ab\P
3591     abA\P
3592     aBAb\P
3593     abaBA\P
3594     abAbaB\P
3595     abaBabA\P
3596     abAbABaBx\P
3597    
3598 ph10 916 /^(..)\1/
3599     aba\P
3600    
3601     /^(..)\1{2,3}x/
3602     aba\P
3603     ababa\P
3604     ababa\P\P
3605     abababx
3606     ababababx
3607    
3608     /^(..)\1{2,3}?x/
3609     aba\P
3610     ababa\P
3611     ababa\P\P
3612     abababx
3613     ababababx
3614    
3615     /^(..)(\1{2,3})ab/
3616     abababab
3617    
3618 ph10 919 /^\R/
3619     \r\P
3620     \r\P\P
3621    
3622     /^\R{2,3}x/
3623     \r\P
3624     \r\P\P
3625     \r\r\P
3626     \r\r\P\P
3627     \r\r\r\P
3628     \r\r\r\P\P
3629     \r\rx
3630     \r\r\rx
3631    
3632     /^\R{2,3}?x/
3633     \r\P
3634     \r\P\P
3635     \r\r\P
3636     \r\r\P\P
3637     \r\r\r\P
3638     \r\r\r\P\P
3639     \r\rx
3640     \r\r\rx
3641    
3642     /^\R?x/
3643     \r\P
3644     \r\P\P
3645     x
3646     \rx
3647    
3648     /^\R+x/
3649     \r\P
3650     \r\P\P
3651     \r\n\P
3652     \r\n\P\P
3653     \rx
3654    
3655     /^a$/<CRLF>
3656     a\r\P
3657     a\r\P\P
3658    
3659     /^a$/m<CRLF>
3660     a\r\P
3661     a\r\P\P
3662    
3663     /^(a$|a\r)/<CRLF>
3664     a\r\P
3665     a\r\P\P
3666    
3667     /^(a$|a\r)/m<CRLF>
3668     a\r\P
3669     a\r\P\P
3670    
3671     /./<CRLF>
3672     \r\P
3673     \r\P\P
3674    
3675     /.{2,3}/<CRLF>
3676     \r\P
3677     \r\P\P
3678     \r\r\P
3679     \r\r\P\P
3680     \r\r\r\P
3681     \r\r\r\P\P
3682    
3683     /.{2,3}?/<CRLF>
3684     \r\P
3685     \r\P\P
3686     \r\r\P
3687     \r\r\P\P
3688     \r\r\r\P
3689     \r\r\r\P\P
3690    
3691 ph10 963 "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
3692     ABCDGHI\O03
3693 ph10 972
3694 ph10 994 /-- These are all run as real matches in test 1; here we are just checking the
3695 ph10 1022 settings of the anchored and startline bits. --/
3696 ph10 963
3697 ph10 994 /(?>.*?a)(?<=ba)/I
3698    
3699     /(?:.*?a)(?<=ba)/I
3700    
3701     /.*?a(*PRUNE)b/I
3702    
3703     /.*?a(*PRUNE)b/sI
3704    
3705     /^a(*PRUNE)b/sI
3706    
3707     /.*?a(*SKIP)b/I
3708    
3709     /(?>.*?a)b/sI
3710    
3711     /(?>.*?a)b/I
3712    
3713     /(?>^a)b/sI
3714    
3715     /(?>.*?)(?<=(abcd)|(wxyz))/I
3716    
3717     /(?>.*)(?<=(abcd)|(wxyz))/I
3718    
3719     "(?>.*)foo"I
3720    
3721     "(?>.*?)foo"I
3722    
3723     /(?>^abc)/mI
3724    
3725     /(?>.*abc)/mI
3726    
3727     /(?:.*abc)/mI
3728    
3729 ph10 1022 /-- Check PCRE_STUDY_EXTRA_NEEDED --/
3730    
3731     /.?/S-I
3732    
3733     /.?/S!I
3734    
3735 ph10 1248 /(?:(a)+(?C1)bb|aa(?C2)b)/
3736     aab\C+
3737    
3738     /(?:(a)++(?C1)bb|aa(?C2)b)/
3739     aab\C+
3740    
3741     /(?:(?>(a))(?C1)bb|aa(?C2)b)/
3742     aab\C+
3743    
3744     /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
3745     aab\C+
3746    
3747     /(?1)(?C1)((a)(?C2)){0}/
3748     aab\C+
3749    
3750     /(?:(a)+(?C1)bb|aa(?C2)b)++/
3751     aab\C+
3752     aab\C+\O2
3753    
3754     /(ab)x|ab/
3755     ab\O3
3756     ab\O2
3757    
3758     /(ab)/
3759     ab\O3
3760     ab\O2
3761 ph10 1251
3762     /(?<=123)(*MARK:xx)abc/K
3763     xxxx123a\P\P
3764     xxxx123a\P
3765    
3766     /123\Kabc/
3767     xxxx123a\P\P
3768     xxxx123a\P
3769 ph10 1248
3770 ph10 1266 /^(?(?=a)aa|bb)/C
3771     bb
3772    
3773     /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
3774     bb
3775    
3776 ph10 1284 /-- Perl seems to have a bug with this one --/
3777    
3778     /aaaaa(*COMMIT)(*PRUNE)b|a+c/
3779     aaaaaac
3780 ph10 1296
3781     /-- Here are some that Perl treats differently because of the way it handles
3782     backtracking verbs. --/
3783 ph10 1284
3784 ph10 1296 /(?!a(*COMMIT)b)ac|ad/
3785     ac
3786     ad
3787    
3788     /^(?!a(*THEN)b|ac)../
3789     ac
3790     ad
3791    
3792     /^(?=a(*THEN)b|ac)/
3793     ac
3794    
3795     /\A.*?(?:a|b(*THEN)c)/
3796     ba
3797    
3798     /\A.*?(?:a|b(*THEN)c)++/
3799     ba
3800    
3801     /\A.*?(?:a|b(*THEN)c|d)/
3802     ba
3803    
3804     /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
3805     aac
3806    
3807     /\A.*?(a|b(*THEN)c)/
3808     ba
3809    
3810     /^(A(*THEN)B|A(*THEN)D)/
3811     AD
3812 ph10 1302
3813     /(?!b(*THEN)a)bn|bnn/
3814     bnn
3815 ph10 1296
3816 ph10 1302 /(?(?=b(*SKIP)a)bn|bnn)/
3817     bnn
3818    
3819     /(?=b(*THEN)a|)bn|bnn/
3820     bnn
3821    
3822 ph10 1299 /-------------------------/
3823 ph10 1296
3824 ph10 1313 /(*LIMIT_MATCH=12bc)abc/
3825    
3826     /(*LIMIT_MATCH=4294967290)abc/
3827    
3828     /(*LIMIT_RECURSION=4294967280)abc/I
3829    
3830     /(a+)*zz/
3831     aaaaaaaaaaaaaz
3832     aaaaaaaaaaaaaz\q3000
3833    
3834     /(a+)*zz/S-
3835     aaaaaaaaaaaaaz\Q10
3836    
3837     /(*LIMIT_MATCH=3000)(a+)*zz/I
3838     aaaaaaaaaaaaaz
3839     aaaaaaaaaaaaaz\q60000
3840    
3841     /(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
3842     aaaaaaaaaaaaaz
3843    
3844     /(*LIMIT_MATCH=60000)(a+)*zz/I
3845     aaaaaaaaaaaaaz
3846     aaaaaaaaaaaaaz\q3000
3847    
3848     /(*LIMIT_RECURSION=10)(a+)*zz/IS-
3849     aaaaaaaaaaaaaz
3850     aaaaaaaaaaaaaz\Q1000
3851    
3852     /(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/IS-
3853     aaaaaaaaaaaaaz
3854    
3855     /(*LIMIT_RECURSION=1000)(a+)*zz/IS-
3856     aaaaaaaaaaaaaz
3857     aaaaaaaaaaaaaz\Q10
3858    
3859 ph10 1352 /-- This test causes a segfault with Perl 5.18.0 --/
3860    
3861     /^(?=(a)){0}b(?1)/
3862     backgammon
3863    
3864 ph10 1361 /(?|(?<n>f)|(?<n>b))/JI
3865    
3866     /(?<a>abc)(?<a>z)\k<a>()/JDZS
3867    
3868 ph10 1363 /a*[bcd]/BZ
3869    
3870     /[bcd]*a/BZ
3871    
3872     /-- A complete set of tests for auto-possessification of character types --/
3873    
3874 zherczeg 1384 /\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\C \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/BZx
3875 ph10 1363
3876 zherczeg 1384 /\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\C \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/BZx
3877 ph10 1363
3878 zherczeg 1384 /\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\C \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/BZx
3879 ph10 1363
3880 zherczeg 1384 /\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\C \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/BZx
3881 ph10 1363
3882 zherczeg 1384 /\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\C \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/BZx
3883 ph10 1363
3884 zherczeg 1384 /\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\C \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/BZx
3885 ph10 1363
3886 zherczeg 1384 /\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\C \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/BZx
3887 ph10 1363
3888 zherczeg 1384 /\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\C \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/BZx
3889 ph10 1363
3890 zherczeg 1384 /\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\C \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/BZx
3891 ph10 1363
3892 zherczeg 1384 /\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\C \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/BZx
3893 ph10 1363
3894 zherczeg 1384 /\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\C \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/BZx
3895 ph10 1363
3896 zherczeg 1384 /\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\C \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/BZx
3897 ph10 1363
3898 zherczeg 1384 / a+\D a+\d a+\S a+\s a+\W a+\w a+. a+\C a+\R a+\H a+\h a+\V a+\v a+\Z a+\z a+$/BZx
3899 ph10 1363
3900 zherczeg 1384 /\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\C \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/BZx
3901 ph10 1363
3902 zherczeg 1384 / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZx
3903 ph10 1363
3904 zherczeg 1384 / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZxs
3905 ph10 1363
3906 zherczeg 1384 /\D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \C+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/BZxm
3907 ph10 1363
3908 ph10 1374 /(?=a+)a(a+)++a/BZ
3909    
3910     /a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/BZ
3911    
3912     /a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/BZ
3913    
3914     /a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/BZ
3915    
3916 ph10 1379 /[ab]*/BZ
3917     aaaa
3918    
3919     /[ab]*?/BZ
3920     aaaa
3921 zherczeg 1381
3922 ph10 1379 /[ab]?/BZ
3923     aaaa
3924 zherczeg 1381
3925 ph10 1379 /[ab]??/BZ
3926     aaaa
3927 zherczeg 1381
3928 ph10 1379 /[ab]+/BZ
3929     aaaa
3930 zherczeg 1381
3931 ph10 1379 /[ab]+?/BZ
3932     aaaa
3933 zherczeg 1381
3934 ph10 1379 /[ab]{2,3}/BZ
3935     aaaa
3936 zherczeg 1381
3937 ph10 1379 /[ab]{2,3}?/BZ
3938     aaaa
3939 zherczeg 1381
3940 ph10 1379 /[ab]{2,}/BZ
3941 zherczeg 1381 aaaa
3942 ph10 1379
3943     /[ab]{2,}?/BZ
3944 zherczeg 1381 aaaa
3945 ph10 1379
3946 zherczeg 1381 /\d+\s{0,5}=\s*\S?=\w{0,4}\W*/BZ
3947    
3948 zherczeg 1382 /[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/BZ
3949    
3950     /[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/BZ
3951    
3952 zherczeg 1383 /a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/BZ
3953    
3954     /[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/BZ
3955    
3956     /[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/BZ
3957    
3958     /[a-c]*d/DZS
3959    
3960     /[a-c]+d/DZS
3961    
3962     /[a-c]?d/DZS
3963    
3964     /[a-c]{4,6}d/DZS
3965    
3966     /[a-c]{0,6}d/DZS
3967    
3968 ph10 1363 /-- End of special auto-possessive tests --/
3969    
3970 ph10 1370 /^A\o{1239}B/
3971     A\123B
3972    
3973     /^A\oB/
3974    
3975     /^A\x{zz}B/
3976    
3977     /^A\x{12Z/
3978    
3979     /^A\x{/
3980    
3981 ph10 1380 /[ab]++/BZO
3982    
3983     /[^ab]*+/BZO
3984    </