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

Contents of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1495 - (hide annotations) (download)
Sat Jul 12 18:22:54 2014 UTC (3 months, 2 weeks ago) by ph10
File size: 65845 byte(s)
Fix compiler crash/misbehaviour for zero-repeated groups that include a 
recursive back reference.

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 612 /abc/IS>testsavedregex
1384 nigel 75 <testsavedregex
1385     abc
1386     ** Failers
1387     bca
1388 ph10 102
1389 ph10 612 /abc/ISS>testsavedregex
1390 nigel 75 <testsavedregex
1391     abc
1392     ** Failers
1393     bca
1394    
1395 ph10 612 /abc/IFS>testsavedregex
1396     <testsavedregex
1397     abc
1398     ** Failers
1399     bca
1400    
1401     /abc/IFSS>testsavedregex
1402     <testsavedregex
1403     abc
1404     ** Failers
1405     bca
1406    
1407 nigel 93 /(a|b)/IS>testsavedregex
1408 nigel 75 <testsavedregex
1409     abc
1410     ** Failers
1411 ph10 102 def
1412    
1413 ph10 612 /(a|b)/ISS>testsavedregex
1414     <testsavedregex
1415     abc
1416     ** Failers
1417     def
1418    
1419 nigel 93 /(a|b)/ISF>testsavedregex
1420 nigel 75 <testsavedregex
1421     abc
1422     ** Failers
1423 ph10 102 def
1424    
1425 ph10 612 /(a|b)/ISSF>testsavedregex
1426     <testsavedregex
1427     abc
1428     ** Failers
1429     def
1430    
1431 nigel 93 ~<(\w+)/?>(.)*</(\1)>~smgI
1432 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>
1433 nigel 75
1434     /^a/IF
1435    
1436 nigel 93 /line\nbreak/I
1437 nigel 77 this is a line\nbreak
1438 ph10 102 line one\nthis is a line\nbreak in the second line
1439 nigel 77
1440 nigel 93 /line\nbreak/If
1441 nigel 77 this is a line\nbreak
1442 ph10 102 ** Failers
1443     line one\nthis is a line\nbreak in the second line
1444 nigel 77
1445 nigel 93 /line\nbreak/Imf
1446 nigel 77 this is a line\nbreak
1447 ph10 102 ** Failers
1448     line one\nthis is a line\nbreak in the second line
1449 nigel 77
1450 nigel 93 /(?i)(?-i)AbCd/I
1451 nigel 79 AbCd
1452     ** Failers
1453 ph10 102 abcd
1454    
1455 nigel 93 /a{11111111111111111111}/I
1456 nigel 79
1457 nigel 93 /(){64294967295}/I
1458 nigel 81
1459 nigel 93 /(){2,4294967295}/I
1460 nigel 81
1461 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
1462 nigel 81 abcdefghijklAkB
1463    
1464 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
1465 nigel 81 abcdefghijklAkB
1466    
1467 nigel 93 "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
1468 nigel 81 abcdefghijklAkB
1469    
1470 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
1471 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1472    
1473 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
1474 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1475    
1476 nigel 93 /[^()]*(?:\((?R)\)[^()]*)*/I
1477 nigel 87 (this(and)that
1478 ph10 102 (this(and)that)
1479 nigel 87 (this(and)that)stuff
1480    
1481 nigel 93 /[^()]*(?:\((?>(?R))\)[^()]*)*/I
1482 nigel 87 (this(and)that
1483 ph10 102 (this(and)that)
1484    
1485 nigel 93 /[^()]*(?:\((?R)\))*[^()]*/I
1486 nigel 87 (this(and)that
1487 ph10 102 (this(and)that)
1488 nigel 87
1489 nigel 93 /(?:\((?R)\))*[^()]*/I
1490 nigel 87 (this(and)that
1491 ph10 102 (this(and)that)
1492     ((this))
1493 nigel 87
1494 nigel 93 /(?:\((?R)\))|[^()]*/I
1495 nigel 87 (this(and)that
1496 ph10 102 (this(and)that)
1497 nigel 87 (this)
1498 ph10 102 ((this))
1499    
1500 nigel 93 /\x{0000ff}/I
1501 nigel 87
1502 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/I
1503 nigel 91
1504 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1505 nigel 91 a1b\CA
1506 ph10 102 a2b\CA
1507 nigel 91 ** Failers
1508 ph10 102 a1b\CZ\CA
1509 ph10 1359
1510     /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/IJ
1511 ph10 102
1512 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1513 nigel 91 ab\CA
1514 ph10 102
1515 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1516 nigel 91 ab\CA
1517 ph10 102 cd\CA
1518    
1519 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1520 ph10 102 cdefgh\CA
1521    
1522 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1523 nigel 91 a1b\GA
1524 ph10 102 a2b\GA
1525 nigel 91 ** Failers
1526 ph10 102 a1b\GZ\GA
1527    
1528 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1529 nigel 91 ab\GA
1530 ph10 102
1531 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1532 nigel 91 ab\GA
1533 ph10 102 cd\GA
1534    
1535 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1536 ph10 102 cdefgh\GA
1537    
1538 nigel 93 /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
1539 nigel 91 a1b\CA
1540 ph10 102 a2b\CA
1541    
1542 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
1543 nigel 91
1544     / In this next test, J is not set at the outer level; consequently it isn't
1545 ph10 102 set in the pattern's options; consequently pcre_get_named_substring() produces
1546 nigel 93 a random value. /Ix
1547 nigel 91
1548 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
1549 nigel 91 a bc d\CA\CB\CC
1550    
1551 nigel 93 /^(?P<A>a)?(?(A)a|b)/I
1552 nigel 91 aabc
1553     bc
1554     ** Failers
1555 ph10 102 abc
1556 nigel 91
1557 nigel 93 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
1558 nigel 91 bXaX
1559    
1560 nigel 93 /(?:(?(2y)a|b)(X))+/I
1561 nigel 91
1562 nigel 93 /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
1563 nigel 91
1564 nigel 93 /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
1565 nigel 91 bbXaaX
1566    
1567 nigel 93 /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
1568 nigel 91 (b)\\Xa\\X
1569    
1570 nigel 93 /(?P<ABC/I
1571 nigel 91
1572 nigel 93 /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1573 nigel 91 bXXaYYaY
1574 ph10 102 bXYaXXaX
1575 nigel 91
1576 nigel 93 /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1577 nigel 91 bXXaYYaY
1578    
1579 nigel 93 /\s*,\s*/IS
1580 nigel 91 \x0b,\x0b
1581 ph10 102 \x0c,\x0d
1582 nigel 91
1583 nigel 93 /^abc/Im
1584 nigel 91 xyz\nabc
1585     xyz\nabc\<lf>
1586     xyz\r\nabc\<lf>
1587     xyz\rabc\<cr>
1588     xyz\r\nabc\<crlf>
1589 ph10 102 ** Failers
1590 nigel 91 xyz\nabc\<cr>
1591     xyz\r\nabc\<cr>
1592     xyz\nabc\<crlf>
1593     xyz\rabc\<crlf>
1594     xyz\rabc\<lf>
1595 ph10 102
1596 nigel 93 /abc$/Im<lf>
1597 nigel 91 xyzabc
1598 ph10 102 xyzabc\n
1599     xyzabc\npqr
1600     xyzabc\r\<cr>
1601     xyzabc\rpqr\<cr>
1602     xyzabc\r\n\<crlf>
1603     xyzabc\r\npqr\<crlf>
1604 nigel 91 ** Failers
1605 ph10 102 xyzabc\r
1606     xyzabc\rpqr
1607     xyzabc\r\n
1608     xyzabc\r\npqr
1609    
1610 nigel 93 /^abc/Im<cr>
1611 nigel 91 xyz\rabcdef
1612     xyz\nabcdef\<lf>
1613 ph10 102 ** Failers
1614 nigel 91 xyz\nabcdef
1615 ph10 102
1616 nigel 93 /^abc/Im<lf>
1617 nigel 91 xyz\nabcdef
1618     xyz\rabcdef\<cr>
1619 ph10 102 ** Failers
1620 nigel 91 xyz\rabcdef
1621 ph10 102
1622 nigel 93 /^abc/Im<crlf>
1623 nigel 91 xyz\r\nabcdef
1624     xyz\rabcdef\<cr>
1625 ph10 102 ** Failers
1626 nigel 91 xyz\rabcdef
1627 ph10 102
1628 nigel 93 /^abc/Im<bad>
1629 nigel 91
1630 nigel 93 /abc/I
1631 nigel 91 xyz\rabc\<bad>
1632 ph10 102 abc
1633    
1634 nigel 93 /.*/I<lf>
1635 nigel 91 abc\ndef
1636     abc\rdef
1637     abc\r\ndef
1638     \<cr>abc\ndef
1639     \<cr>abc\rdef
1640     \<cr>abc\r\ndef
1641     \<crlf>abc\ndef
1642     \<crlf>abc\rdef
1643     \<crlf>abc\r\ndef
1644    
1645 nigel 93 /\w+(.)(.)?def/Is
1646 nigel 91 abc\ndef
1647     abc\rdef
1648     abc\r\ndef
1649    
1650 nigel 93 +((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I
1651 nigel 91 /* this is a C style comment */\M
1652    
1653 nigel 93 /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
1654 nigel 91
1655 nigel 93 /()()()()()()()()()()()()()()()()()()()()
1656     ()()()()()()()()()()()()()()()()()()()()
1657     ()()()()()()()()()()()()()()()()()()()()
1658     ()()()()()()()()()()()()()()()()()()()()
1659     ()()()()()()()()()()()()()()()()()()()()
1660     (.(.))/Ix
1661 ph10 102 XY\O400
1662 nigel 93
1663     /(a*b|(?i:c*(?-i)d))/IS
1664    
1665     /()[ab]xyz/IS
1666    
1667     /(|)[ab]xyz/IS
1668    
1669     /(|c)[ab]xyz/IS
1670    
1671     /(|c?)[ab]xyz/IS
1672    
1673     /(d?|c?)[ab]xyz/IS
1674    
1675     /(d?|c)[ab]xyz/IS
1676    
1677 ph10 161 /^a*b\d/DZ
1678 nigel 93
1679 ph10 161 /^a*+b\d/DZ
1680 nigel 93
1681 ph10 161 /^a*?b\d/DZ
1682 nigel 93
1683 ph10 161 /^a+A\d/DZ
1684 nigel 93 aaaA5
1685     ** Failers
1686 ph10 102 aaaa5
1687 nigel 93
1688 ph10 161 /^a*A\d/IiDZ
1689 nigel 93 aaaA5
1690     aaaa5
1691    
1692     /(a*|b*)[cd]/IS
1693    
1694     /(a+|b*)[cd]/IS
1695    
1696     /(a*|b+)[cd]/IS
1697    
1698     /(a+|b+)[cd]/IS
1699    
1700     /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1701     ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1702     (((
1703     a
1704     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1705     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1706 ph10 102 )))
1707     /Ix
1708 nigel 93 large nest
1709    
1710 ph10 162 /a*\d/BZ
1711 nigel 93
1712 ph10 162 /a*\D/BZ
1713 nigel 93
1714 ph10 162 /0*\d/BZ
1715 nigel 93
1716 ph10 162 /0*\D/BZ
1717 nigel 93
1718 ph10 162 /a*\s/BZ
1719 nigel 93
1720 ph10 162 /a*\S/BZ
1721 nigel 93
1722 ph10 162 / *\s/BZ
1723 nigel 93
1724 ph10 162 / *\S/BZ
1725 nigel 93
1726 ph10 162 /a*\w/BZ
1727 nigel 93
1728 ph10 162 /a*\W/BZ
1729 nigel 93
1730 ph10 162 /=*\w/BZ
1731 nigel 93
1732 ph10 162 /=*\W/BZ
1733 nigel 93
1734 ph10 162 /\d*a/BZ
1735 nigel 93
1736 ph10 162 /\d*2/BZ
1737 nigel 93
1738 ph10 162 /\d*\d/BZ
1739 nigel 93
1740 ph10 162 /\d*\D/BZ
1741 nigel 93
1742 ph10 162 /\d*\s/BZ
1743 nigel 93
1744 ph10 162 /\d*\S/BZ
1745 nigel 93
1746 ph10 162 /\d*\w/BZ
1747 nigel 93
1748 ph10 162 /\d*\W/BZ
1749 nigel 93
1750 ph10 162 /\D*a/BZ
1751 nigel 93
1752 ph10 162 /\D*2/BZ
1753 nigel 93
1754 ph10 162 /\D*\d/BZ
1755 nigel 93
1756 ph10 162 /\D*\D/BZ
1757 nigel 93
1758 ph10 162 /\D*\s/BZ
1759 nigel 93
1760 ph10 162 /\D*\S/BZ
1761 nigel 93
1762 ph10 162 /\D*\w/BZ
1763 nigel 93
1764 ph10 162 /\D*\W/BZ
1765 nigel 93
1766 ph10 162 /\s*a/BZ
1767 nigel 93
1768 ph10 162 /\s*2/BZ
1769 nigel 93
1770 ph10 162 /\s*\d/BZ
1771 nigel 93
1772 ph10 162 /\s*\D/BZ
1773 nigel 93
1774 ph10 162 /\s*\s/BZ
1775 nigel 93
1776 ph10 162 /\s*\S/BZ
1777 nigel 93
1778 ph10 162 /\s*\w/BZ
1779 nigel 93
1780 ph10 162 /\s*\W/BZ
1781 nigel 93
1782 ph10 162 /\S*a/BZ
1783 nigel 93
1784 ph10 162 /\S*2/BZ
1785 nigel 93
1786 ph10 162 /\S*\d/BZ
1787 nigel 93
1788 ph10 162 /\S*\D/BZ
1789 nigel 93
1790 ph10 162 /\S*\s/BZ
1791 nigel 93
1792 ph10 162 /\S*\S/BZ
1793 nigel 93
1794 ph10 162 /\S*\w/BZ
1795 nigel 93
1796 ph10 162 /\S*\W/BZ
1797 nigel 93
1798 ph10 162 /\w*a/BZ
1799 nigel 93
1800 ph10 162 /\w*2/BZ
1801 nigel 93
1802 ph10 162 /\w*\d/BZ
1803 nigel 93
1804 ph10 162 /\w*\D/BZ
1805 nigel 93
1806 ph10 162 /\w*\s/BZ
1807 nigel 93
1808 ph10 162 /\w*\S/BZ
1809 nigel 93
1810 ph10 162 /\w*\w/BZ
1811 nigel 93
1812 ph10 162 /\w*\W/BZ
1813 nigel 93
1814 ph10 162 /\W*a/BZ
1815 nigel 93
1816 ph10 162 /\W*2/BZ
1817 nigel 93
1818 ph10 162 /\W*\d/BZ
1819 nigel 93
1820 ph10 162 /\W*\D/BZ
1821 nigel 93
1822 ph10 162 /\W*\s/BZ
1823 nigel 93
1824 ph10 162 /\W*\S/BZ
1825 nigel 93
1826 ph10 162 /\W*\w/BZ
1827 nigel 93
1828 ph10 162 /\W*\W/BZ
1829 nigel 93
1830 ph10 162 /[^a]+a/BZ
1831 nigel 93
1832 ph10 162 /[^a]+a/BZi
1833 nigel 93
1834 ph10 162 /[^a]+A/BZi
1835 nigel 93
1836 ph10 162 /[^a]+b/BZ
1837 nigel 93
1838 ph10 162 /[^a]+\d/BZ
1839 nigel 93
1840 ph10 162 /a*[^a]/BZ
1841 nigel 93
1842     /(?P<abc>x)(?P<xyz>y)/I
1843     xy\Cabc\Cxyz
1844    
1845     /(?<abc>x)(?'xyz'y)/I
1846     xy\Cabc\Cxyz
1847    
1848     /(?<abc'x)(?'xyz'y)/I
1849    
1850     /(?<abc>x)(?'xyz>y)/I
1851    
1852     /(?P'abc'x)(?P<xyz>y)/I
1853    
1854     /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
1855     bXaX
1856     bXbX
1857     ** Failers
1858 ph10 102 aXaX
1859     aXbX
1860 nigel 93
1861     /^(?P>abc)(?<abcd>xxx)/
1862    
1863     /^(?P>abc)(?<abc>x|y)/
1864     xx
1865     xy
1866     yy
1867 ph10 102 yx
1868 nigel 93
1869     /^(?P>abc)(?P<abc>x|y)/
1870     xx
1871     xy
1872     yy
1873 ph10 102 yx
1874 nigel 93
1875     /^((?(abc)a|b)(?<abc>x|y))+/
1876     bxay
1877 ph10 102 bxby
1878 nigel 93 ** Failers
1879 ph10 102 axby
1880 nigel 93
1881     /^(((?P=abc)|X)(?<abc>x|y))+/
1882     XxXxxx
1883     XxXyyx
1884     XxXyxx
1885     ** Failers
1886 ph10 102 x
1887 nigel 93
1888     /^(?1)(abc)/
1889     abcabc
1890    
1891     /^(?:(?:\1|X)(a|b))+/
1892     Xaaa
1893 ph10 102 Xaba
1894 nigel 93
1895 ph10 162 /^[\E\Qa\E-\Qz\E]+/BZ
1896 ph10 102
1897 ph10 162 /^[a\Q]bc\E]/BZ
1898 ph10 102
1899 ph10 162 /^[a-\Q\E]/BZ
1900 nigel 93
1901 ph10 162 /^(?P>abc)[()](?<abc>)/BZ
1902 nigel 93
1903 ph10 162 /^((?(abc)y)[()](?P<abc>x))+/BZ
1904 nigel 93 (xy)x
1905    
1906 ph10 162 /^(?P>abc)\Q()\E(?<abc>)/BZ
1907 nigel 93
1908 ph10 162 /^(?P>abc)[a\Q(]\E(](?<abc>)/BZ
1909 ph10 102
1910 nigel 93 /^(?P>abc) # this is (a comment)
1911 ph10 162 (?<abc>)/BZx
1912 nigel 93
1913     /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
1914     1221
1915     Satan, oscillate my metallic sonatas!
1916     A man, a plan, a canal: Panama!
1917 ph10 102 Able was I ere I saw Elba.
1918 nigel 93 *** Failers
1919 ph10 102 The quick brown fox
1920    
1921 nigel 93 /(?=(\w+))\1:/I
1922     abcd:
1923    
1924     /(?=(?'abc'\w+))\k<abc>:/I
1925     abcd:
1926    
1927     /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
1928     adaa
1929     ** Failers
1930     addd
1931 ph10 102 adbb
1932 nigel 93
1933     /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/J
1934     bdaa
1935     bdab
1936     ** Failers
1937 ph10 102 bddd
1938 nigel 93
1939     /(?(<bc))/
1940    
1941 ph10 102 /(?(''))/
1942 nigel 93
1943     /(?('R')stuff)/
1944    
1945     /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
1946     abcabc1Xabc2XabcXabcabc
1947    
1948     /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1949     abcabc1Xabc2XabcXabcabc
1950    
1951 ph10 1394 /(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1952 nigel 93
1953     /^(?(DEFINE) abc | xyz ) /x
1954 ph10 102
1955 nigel 93 /(?(DEFINE) abc) xyz/xI
1956    
1957     /(a|)*\d/
1958     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1959     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
1960    
1961     /^a.b/<lf>
1962     a\rb
1963 ph10 102 a\nb\<cr>
1964 ph10 149 a\x85b\<anycrlf>
1965 nigel 93 ** Failers
1966     a\nb
1967     a\nb\<any>
1968 ph10 102 a\rb\<cr>
1969     a\rb\<any>
1970 ph10 149 a\x85b\<any>
1971     a\rb\<anycrlf>
1972 nigel 93
1973     /^abc./mgx<any>
1974 ph10 355 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
1975 nigel 93
1976     /abc.$/mgx<any>
1977 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
1978 nigel 93
1979     /a/<cr><any>
1980    
1981     /a/<any><crlf>
1982    
1983 ph10 247 /^a\Rb/<bsr_unicode>
1984 nigel 93 a\nb
1985     a\rb
1986     a\r\nb
1987     a\x0bb
1988     a\x0cb
1989 ph10 102 a\x85b
1990 nigel 93 ** Failers
1991 ph10 102 a\n\rb
1992 nigel 93
1993 ph10 247 /^a\R*b/<bsr_unicode>
1994 nigel 93 ab
1995     a\nb
1996     a\rb
1997     a\r\nb
1998     a\x0bb
1999     a\x0cb
2000 ph10 102 a\x85b
2001     a\n\rb
2002     a\n\r\x85\x0cb
2003 nigel 93
2004 ph10 247 /^a\R+b/<bsr_unicode>
2005 nigel 93 a\nb
2006     a\rb
2007     a\r\nb
2008     a\x0bb
2009     a\x0cb
2010 ph10 102 a\x85b
2011     a\n\rb
2012     a\n\r\x85\x0cb
2013 nigel 93 ** Failers
2014 ph10 102 ab
2015    
2016 ph10 247 /^a\R{1,3}b/<bsr_unicode>
2017 nigel 93 a\nb
2018     a\n\rb
2019     a\n\r\x85b
2020 ph10 102 a\r\n\r\nb
2021     a\r\n\r\n\r\nb
2022 nigel 93 a\n\r\n\rb
2023 ph10 102 a\n\n\r\nb
2024 nigel 93 ** Failers
2025     a\n\n\n\rb
2026     a\r
2027    
2028 ph10 247 /^a[\R]b/<bsr_unicode>
2029 nigel 93 aRb
2030     ** Failers
2031 ph10 102 a\nb
2032 nigel 93
2033     /(?&abc)X(?<abc>P)/I
2034     abcPXP123
2035    
2036     /(?1)X(?<abc>P)/I
2037     abcPXP123
2038    
2039     /(?:a(?&abc)b)*(?<abc>x)/
2040     123axbaxbaxbx456
2041     123axbaxbaxb456
2042 ph10 102
2043 nigel 93 /(?:a(?&abc)b){1,5}(?<abc>x)/
2044     123axbaxbaxbx456
2045    
2046     /(?:a(?&abc)b){2,5}(?<abc>x)/
2047     123axbaxbaxbx456
2048    
2049     /(?:a(?&abc)b){2,}(?<abc>x)/
2050     123axbaxbaxbx456
2051    
2052     /(abc)(?i:(?1))/
2053     defabcabcxyz
2054     DEFabcABCXYZ
2055    
2056     /(abc)(?:(?i)(?1))/
2057     defabcabcxyz
2058     DEFabcABCXYZ
2059    
2060     /^(a)\g-2/
2061    
2062     /^(a)\g/
2063    
2064     /^(a)\g{0}/
2065    
2066     /^(a)\g{3/
2067    
2068 ph10 1394 /^(a)\g{aa}/
2069 nigel 93
2070     /^a.b/<lf>
2071     a\rb
2072     *** Failers
2073     a\nb
2074    
2075     /.+foo/
2076     afoo
2077 ph10 102 ** Failers
2078     \r\nfoo
2079     \nfoo
2080 nigel 93
2081     /.+foo/<crlf>
2082     afoo
2083 ph10 102 \nfoo
2084     ** Failers
2085     \r\nfoo
2086 nigel 93
2087     /.+foo/<any>
2088     afoo
2089 ph10 102 ** Failers
2090     \nfoo
2091     \r\nfoo
2092 nigel 93
2093     /.+foo/s
2094     afoo
2095 ph10 102 \r\nfoo
2096     \nfoo
2097 ph10 131
2098     /^$/mg<any>
2099     abc\r\rxyz
2100     abc\n\rxyz
2101     ** Failers
2102     abc\r\nxyz
2103 nigel 93
2104 ph10 141 /(?m)^$/<any>g+
2105     abc\r\n\r\n
2106    
2107 ph10 143 /(?m)^$|^\r\n/<any>g+
2108     abc\r\n\r\n
2109    
2110     /(?m)$/<any>g+
2111     abc\r\n\r\n
2112    
2113 ph10 149 /abc.$/mgx<anycrlf>
2114 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
2115 ph10 149
2116 ph10 155 /^X/m
2117     XABC
2118     ** Failers
2119     XABC\B
2120    
2121 ph10 174 /(ab|c)(?-1)/BZ
2122 ph10 166 abc
2123    
2124 ph10 174 /xy(?+1)(abc)/BZ
2125 ph10 166 xyabcabc
2126     ** Failers
2127     xyabc
2128    
2129     /x(?-0)y/
2130    
2131     /x(?-1)y/
2132    
2133     /x(?+0)y/
2134    
2135     /x(?+1)y/
2136    
2137 ph10 174 /^(abc)?(?(-1)X|Y)/BZ
2138 ph10 167 abcX
2139     Y
2140     ** Failers
2141     abcY
2142    
2143 ph10 174 /^((?(+1)X|Y)(abc))+/BZ
2144 ph10 167 YabcXabc
2145     YabcXabcXabc
2146     ** Failers
2147     XabcXabc
2148    
2149 ph10 174 /(?(-1)a)/BZ
2150 ph10 167
2151 ph10 174 /((?(-1)a))/BZ
2152 ph10 167
2153 ph10 174 /((?(-2)a))/BZ
2154 ph10 167
2155 ph10 270 /^(?(+1)X|Y)(.)/BZ
2156     Y!
2157 ph10 167
2158 ph10 171 /(?<A>tom|bon)-\k{A}/
2159     tom-tom
2160     bon-bon
2161     ** Failers
2162     tom-bon
2163    
2164     /\g{A/
2165    
2166 ph10 175 /(?|(abc)|(xyz))/BZ
2167     >abc<
2168     >xyz<
2169    
2170     /(x)(?|(abc)|(xyz))(x)/BZ
2171     xabcx
2172     xxyzx
2173    
2174     /(x)(?|(abc)(pqr)|(xyz))(x)/BZ
2175     xabcpqrx
2176     xxyzx
2177    
2178 ph10 180 /\H++X/BZ
2179     ** Failers
2180     XXXX
2181    
2182     /\H+\hY/BZ
2183     XXXX Y
2184    
2185     /\H+ Y/BZ
2186    
2187     /\h+A/BZ
2188    
2189     /\v*B/BZ
2190    
2191     /\V+\x0a/BZ
2192    
2193     /A+\h/BZ
2194    
2195     / *\H/BZ
2196    
2197     /A*\v/BZ
2198    
2199     /\x0b*\V/BZ
2200    
2201     /\d+\h/BZ
2202    
2203     /\d*\v/BZ
2204    
2205     /S+\h\S+\v/BZ
2206    
2207     /\w{3,}\h\w+\v/BZ
2208    
2209     /\h+\d\h+\w\h+\S\h+\H/BZ
2210    
2211     /\v+\d\v+\w\v+\S\v+\V/BZ
2212    
2213     /\H+\h\H+\d/BZ
2214    
2215     /\V+\v\V+\w/BZ
2216    
2217 ph10 197 /\( (?: [^()]* | (?R) )* \)/x
2218 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)
2219 ph10 197
2220 ph10 205 /[\E]AAA/
2221    
2222     /[\Q\E]AAA/
2223    
2224     /[^\E]AAA/
2225    
2226     /[^\Q\E]AAA/
2227    
2228     /[\E^]AAA/
2229    
2230     /[\Q\E^]AAA/
2231    
2232 ph10 210 /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ
2233    
2234     /^a+(*FAIL)/C
2235     aaaaaa
2236    
2237     /a+b?c+(*FAIL)/C
2238     aaabccc
2239    
2240     /a+b?(*PRUNE)c+(*FAIL)/C
2241     aaabccc
2242    
2243     /a+b?(*COMMIT)c+(*FAIL)/C
2244     aaabccc
2245    
2246     /a+b?(*SKIP)c+(*FAIL)/C
2247     aaabcccaaabccc
2248    
2249     /a+b?(*THEN)c+(*FAIL)/C
2250     aaabccc
2251    
2252     /a(*MARK)b/
2253    
2254 ph10 213 /(?i:A{1,}\6666666666)/
2255    
2256     /\g6666666666/
2257    
2258 ph10 640 /[\g6666666666]/BZ
2259 ph10 213
2260 ph10 215 /(?1)\c[/
2261    
2262 ph10 226 /.+A/<crlf>
2263     \r\nA
2264    
2265     /\nA/<crlf>
2266     \r\nA
2267    
2268     /[\r\n]A/<crlf>
2269     \r\nA
2270    
2271     /(\r|\n)A/<crlf>
2272     \r\nA
2273    
2274 ph10 227 /a(*CR)b/
2275    
2276     /(*CR)a.b/
2277     a\nb
2278     ** Failers
2279     a\rb
2280    
2281     /(*CR)a.b/<lf>
2282     a\nb
2283     ** Failers
2284     a\rb
2285    
2286     /(*LF)a.b/<CRLF>
2287     a\rb
2288     ** Failers
2289     a\nb
2290    
2291     /(*CRLF)a.b/
2292     a\rb
2293     a\nb
2294     ** Failers
2295     a\r\nb
2296    
2297     /(*ANYCRLF)a.b/<CR>
2298     ** Failers
2299     a\rb
2300     a\nb
2301     a\r\nb
2302    
2303     /(*ANY)a.b/<cr>
2304     ** Failers
2305     a\rb
2306     a\nb
2307     a\r\nb
2308     a\x85b
2309 ph10 566
2310     /(*ANY).*/g
2311     abc\r\ndef
2312 ph10 227
2313 ph10 566 /(*ANYCRLF).*/g
2314     abc\r\ndef
2315    
2316     /(*CRLF).*/g
2317     abc\r\ndef
2318    
2319 ph10 231 /a\Rb/I<bsr_anycrlf>
2320     a\rb
2321     a\nb
2322     a\r\nb
2323     ** Failers
2324     a\x85b
2325     a\x0bb
2326    
2327     /a\Rb/I<bsr_unicode>
2328     a\rb
2329     a\nb
2330     a\r\nb
2331     a\x85b
2332     a\x0bb
2333     ** Failers
2334     a\x85b\<bsr_anycrlf>
2335     a\x0bb\<bsr_anycrlf>
2336    
2337     /a\R?b/I<bsr_anycrlf>
2338     a\rb
2339     a\nb
2340     a\r\nb
2341     ** Failers
2342     a\x85b
2343     a\x0bb
2344    
2345     /a\R?b/I<bsr_unicode>
2346     a\rb
2347     a\nb
2348     a\r\nb
2349     a\x85b
2350     a\x0bb
2351     ** Failers
2352     a\x85b\<bsr_anycrlf>
2353     a\x0bb\<bsr_anycrlf>
2354    
2355     /a\R{2,4}b/I<bsr_anycrlf>
2356     a\r\n\nb
2357     a\n\r\rb
2358     a\r\n\r\n\r\n\r\nb
2359     ** Failers
2360     a\x85\85b
2361     a\x0b\0bb
2362    
2363     /a\R{2,4}b/I<bsr_unicode>
2364     a\r\rb
2365     a\n\n\nb
2366     a\r\n\n\r\rb
2367     a\x85\85b
2368     a\x0b\0bb
2369     ** Failers
2370     a\r\r\r\r\rb
2371     a\x85\85b\<bsr_anycrlf>
2372     a\x0b\0bb\<bsr_anycrlf>
2373    
2374     /(*BSR_ANYCRLF)a\Rb/I
2375     a\nb
2376     a\rb
2377    
2378     /(*BSR_UNICODE)a\Rb/I
2379     a\x85b
2380    
2381     /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
2382     a\nb
2383     a\rb
2384    
2385     /(*CRLF)(*BSR_UNICODE)a\Rb/I
2386     a\x85b
2387    
2388     /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
2389    
2390 ph10 268 /(?<a>)(?&)/
2391    
2392     /(?<abc>)(?&a)/
2393    
2394     /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
2395    
2396 ph10 269 /(?+-a)/
2397    
2398     /(?-+a)/
2399    
2400 ph10 271 /(?(-1))/
2401    
2402     /(?(+10))/
2403    
2404     /(?(10))/
2405    
2406     /(?(+2))()()/
2407    
2408     /(?(2))()()/
2409    
2410 ph10 272 /\k''/
2411    
2412     /\k<>/
2413    
2414     /\k{}/
2415    
2416 ph10 629 /\k/
2417    
2418     /\kabc/
2419    
2420 ph10 272 /(?P=)/
2421    
2422     /(?P>)/
2423    
2424 ph10 282 /(?!\w)(?R)/
2425    
2426     /(?=\w)(?R)/
2427    
2428     /(?<!\w)(?R)/
2429    
2430     /(?<=\w)(?R)/
2431    
2432 ph10 295 /[[:foo:]]/
2433    
2434     /[[:1234:]]/
2435    
2436     /[[:f\oo:]]/
2437    
2438     /[[: :]]/
2439    
2440     /[[:...:]]/
2441    
2442     /[[:l\ower:]]/
2443    
2444     /[[:abc\:]]/
2445    
2446     /[abc[:x\]pqr:]]/
2447    
2448     /[[:a\dz:]]/
2449    
2450 ph10 333 /(^(a|b\g<-1'c))/
2451    
2452 ph10 335 /^(?+1)(?<a>x|y){0}z/
2453     xzxx
2454     yzyy
2455     ** Failers
2456     xxz
2457    
2458 ph10 336 /(\3)(\1)(a)/
2459     cat
2460    
2461     /(\3)(\1)(a)/<JS>
2462     cat
2463    
2464     /TA]/
2465     The ACTA] comes
2466    
2467     /TA]/<JS>
2468     The ACTA] comes
2469    
2470 ph10 340 /(?2)[]a()b](abc)/
2471     abcbabc
2472    
2473     /(?2)[^]a()b](abc)/
2474     abcbabc
2475    
2476     /(?1)[]a()b](abc)/
2477     abcbabc
2478     ** Failers
2479     abcXabc
2480    
2481     /(?1)[^]a()b](abc)/
2482     abcXabc
2483     ** Failers
2484     abcbabc
2485    
2486     /(?2)[]a()b](abc)(xyz)/
2487     xyzbabcxyz
2488    
2489     /(?&N)[]a(?<N>)](?<M>abc)/
2490     abc<abc
2491    
2492     /(?&N)[]a(?<N>)](abc)/
2493     abc<abc
2494    
2495 ph10 341 /a[]b/
2496    
2497     /a[^]b/
2498    
2499     /a[]b/<JS>
2500     ** Failers
2501     ab
2502    
2503     /a[]+b/<JS>
2504     ** Failers
2505     ab
2506    
2507     /a[]*+b/<JS>
2508     ** Failers
2509     ab
2510    
2511     /a[^]b/<JS>
2512     aXb
2513     a\nb
2514     ** Failers
2515     ab
2516    
2517     /a[^]+b/<JS>
2518     aXb
2519     a\nX\nXb
2520     ** Failers
2521     ab
2522    
2523 ph10 1393 /a(?!)b/BZ
2524 ph10 341
2525 ph10 1393 /(?!)?a/BZ
2526     ab
2527    
2528 ph10 341 /a(*FAIL)+b/
2529    
2530 ph10 353 /(abc|pqr|123){0}[xyz]/SI
2531    
2532 ph10 381 /(?(?=.*b)b|^)/CI
2533     adc
2534     abc
2535    
2536     /(?(?=b).*b|^d)/I
2537    
2538     /(?(?=.*b).*b|^d)/I
2539    
2540 ph10 389 /xyz/C
2541     xyz
2542     abcxyz
2543     abcxyz\Y
2544     ** Failers
2545     abc
2546     abc\Y
2547     abcxypqr
2548     abcxypqr\Y
2549 ph10 576
2550     /(*NO_START_OPT)xyz/C
2551 ph10 1395 abcxyz
2552    
2553     /(*NO_AUTO_POSSESS)a+b/BZ
2554 ph10 389
2555 ph10 576 /xyz/CY
2556     abcxyz
2557    
2558 ph10 399 /^"((?(?=[a])[^"])|b)*"$/C
2559     "ab"
2560    
2561     /^"((?(?=[a])[^"])|b)*"$/
2562     "ab"
2563    
2564 ph10 408 /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
2565     XYabcdY
2566    
2567     /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
2568     XYabcdY
2569    
2570 ph10 426 /Xa{2,4}b/
2571     X\P
2572     Xa\P
2573     Xaa\P
2574     Xaaa\P
2575     Xaaaa\P
2576    
2577     /Xa{2,4}?b/
2578     X\P
2579     Xa\P
2580     Xaa\P
2581     Xaaa\P
2582     Xaaaa\P
2583    
2584     /Xa{2,4}+b/
2585     X\P
2586     Xa\P
2587     Xaa\P
2588     Xaaa\P
2589     Xaaaa\P
2590    
2591     /X\d{2,4}b/
2592     X\P
2593     X3\P
2594     X33\P
2595     X333\P
2596     X3333\P
2597    
2598     /X\d{2,4}?b/
2599     X\P
2600     X3\P
2601     X33\P
2602     X333\P
2603     X3333\P
2604    
2605     /X\d{2,4}+b/
2606     X\P
2607     X3\P
2608     X33\P
2609     X333\P
2610     X3333\P
2611    
2612     /X\D{2,4}b/
2613     X\P
2614     Xa\P
2615     Xaa\P
2616     Xaaa\P
2617     Xaaaa\P
2618    
2619     /X\D{2,4}?b/
2620     X\P
2621     Xa\P
2622     Xaa\P
2623     Xaaa\P
2624     Xaaaa\P
2625    
2626     /X\D{2,4}+b/
2627     X\P
2628     Xa\P
2629     Xaa\P
2630     Xaaa\P
2631     Xaaaa\P
2632    
2633     /X[abc]{2,4}b/
2634     X\P
2635     Xa\P
2636     Xaa\P
2637     Xaaa\P
2638     Xaaaa\P
2639    
2640     /X[abc]{2,4}?b/
2641     X\P
2642     Xa\P
2643     Xaa\P
2644     Xaaa\P
2645     Xaaaa\P
2646    
2647     /X[abc]{2,4}+b/
2648     X\P
2649     Xa\P
2650     Xaa\P
2651     Xaaa\P
2652     Xaaaa\P
2653    
2654     /X[^a]{2,4}b/
2655     X\P
2656     Xz\P
2657     Xzz\P
2658     Xzzz\P
2659     Xzzzz\P
2660    
2661     /X[^a]{2,4}?b/
2662     X\P
2663     Xz\P
2664     Xzz\P
2665     Xzzz\P
2666     Xzzzz\P
2667    
2668     /X[^a]{2,4}+b/
2669     X\P
2670     Xz\P
2671     Xzz\P
2672     Xzzz\P
2673     Xzzzz\P
2674    
2675     /(Y)X\1{2,4}b/
2676     YX\P
2677     YXY\P
2678     YXYY\P
2679     YXYYY\P
2680     YXYYYY\P
2681    
2682     /(Y)X\1{2,4}?b/
2683     YX\P
2684     YXY\P
2685     YXYY\P
2686     YXYYY\P
2687     YXYYYY\P
2688    
2689     /(Y)X\1{2,4}+b/
2690     YX\P
2691     YXY\P
2692     YXYY\P
2693     YXYYY\P
2694     YXYYYY\P
2695    
2696     /\++\KZ|\d+X|9+Y/
2697     ++++123999\P
2698     ++++123999Y\P
2699     ++++Z1234\P
2700    
2701     /Z(*F)/
2702     Z\P
2703     ZA\P
2704    
2705     /Z(?!)/
2706     Z\P
2707     ZA\P
2708    
2709 ph10 427 /dog(sbody)?/
2710     dogs\P
2711     dogs\P\P
2712    
2713 ph10 428 /dog(sbody)??/
2714     dogs\P
2715     dogs\P\P
2716    
2717 ph10 427 /dog|dogsbody/
2718     dogs\P
2719     dogs\P\P
2720    
2721 ph10 428 /dogsbody|dog/
2722     dogs\P
2723     dogs\P\P
2724    
2725     /\bthe cat\b/
2726     the cat\P
2727     the cat\P\P
2728    
2729     /abc/
2730     abc\P
2731     abc\P\P
2732 ph10 432
2733 ph10 435 /abc\K123/
2734     xyzabc123pqr
2735     xyzabc12\P
2736     xyzabc12\P\P
2737    
2738     /(?<=abc)123/
2739     xyzabc123pqr
2740     xyzabc12\P
2741     xyzabc12\P\P
2742    
2743     /\babc\b/
2744     +++abc+++
2745     +++ab\P
2746     +++ab\P\P
2747    
2748 ph10 438 /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
2749    
2750     /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
2751    
2752 ph10 449 /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
2753    
2754 ph10 442 /abc\K/+
2755     abcdef
2756     abcdef\N\N
2757     xyzabcdef\N\N
2758     ** Failers
2759     abcdef\N
2760     xyzabcdef\N
2761    
2762     /^(?:(?=abc)|abc\K)/+
2763     abcdef
2764     abcdef\N\N
2765     ** Failers
2766     abcdef\N
2767    
2768     /a?b?/+
2769     xyz
2770     xyzabc
2771     xyzabc\N
2772     xyzabc\N\N
2773     xyz\N\N
2774     ** Failers
2775     xyz\N
2776    
2777     /^a?b?/+
2778     xyz
2779     xyzabc
2780     ** Failers
2781     xyzabc\N
2782     xyzabc\N\N
2783     xyz\N\N
2784     xyz\N
2785    
2786 ph10 448 /^(?<name>a|b\g<name>c)/
2787     aaaa
2788     bacxxx
2789     bbaccxxx
2790     bbbacccxx
2791    
2792     /^(?<name>a|b\g'name'c)/
2793     aaaa
2794     bacxxx
2795     bbaccxxx
2796     bbbacccxx
2797    
2798     /^(a|b\g<1>c)/
2799     aaaa
2800     bacxxx
2801     bbaccxxx
2802     bbbacccxx
2803    
2804     /^(a|b\g'1'c)/
2805     aaaa
2806     bacxxx
2807     bbaccxxx
2808     bbbacccxx
2809    
2810     /^(a|b\g'-1'c)/
2811     aaaa
2812     bacxxx
2813     bbaccxxx
2814     bbbacccxx
2815    
2816     /(^(a|b\g<-1>c))/
2817     aaaa
2818     bacxxx
2819     bbaccxxx
2820     bbbacccxx
2821    
2822     /(?-i:\g<name>)(?i:(?<name>a))/
2823     XaaX
2824     XAAX
2825    
2826     /(?i:\g<name>)(?-i:(?<name>a))/
2827     XaaX
2828     ** Failers
2829     XAAX
2830    
2831     /(?-i:\g<+1>)(?i:(a))/
2832     XaaX
2833     XAAX
2834    
2835     /(?=(?<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>\})\}))\{/
2836    
2837     /(?<n>a|b|c)\g<n>*/
2838     abc
2839     accccbbb
2840    
2841     /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2842     XYabcdY
2843    
2844 ph10 454 /(?<=b(?1)|zzz)(a)/
2845     xbaax
2846     xzzzax
2847    
2848     /(a)(?<=b\1)/
2849    
2850     /(a)(?<=b+(?1))/
2851    
2852     /(a+)(?<=b(?1))/
2853    
2854     /(a(?<=b(?1)))/
2855    
2856     /(?<=b(?1))xyz/
2857    
2858     /(?<=b(?1))xyz(b+)pqrstuvew/
2859    
2860 ph10 455 /(a|bc)\1/SI
2861    
2862     /(a|bc)\1{2,3}/SI
2863    
2864     /(a|bc)(?1)/SI
2865    
2866     /(a|b\1)(a|b\1)/SI
2867    
2868     /(a|b\1){2}/SI
2869    
2870     /(a|bbbb\1)(a|bbbb\1)/SI
2871    
2872     /(a|bbbb\1){2}/SI
2873    
2874     /^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
2875    
2876     /<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
2877    
2878     "(?>.*/)foo"SI
2879    
2880     /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
2881    
2882     /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
2883    
2884     /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
2885    
2886     /<a[\s]+href[\s]*=[\s]* # find <a href=
2887     ([\"\'])? # find single or double quote
2888     (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
2889     # quote, otherwise match up to next space
2890     /isxSI
2891    
2892     /^(?!:) # colon disallowed at start
2893     (?: # start of item
2894     (?: [0-9a-f]{1,4} | # 1-4 hex digits or
2895     (?(1)0 | () ) ) # if null previously matched, fail; else null
2896     : # followed by colon
2897     ){1,7} # end item; 1-7 of them required
2898     [0-9a-f]{1,4} $ # final hex number at end of string
2899     (?(1)|.) # check that there was an empty component
2900     /xiIS
2901    
2902 ph10 457 /(?|(?<a>A)|(?<a>B))/I
2903     AB\Ca
2904     BA\Ca
2905    
2906     /(?|(?<a>A)|(?<b>B))/
2907    
2908 ph10 459 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
2909     b(?<quote> (?<apostrophe>')|(?<realquote>")) )
2910     (?('quote')[a-z]+|[0-9]+)/JIx
2911     a"aaaaa
2912     b"aaaaa
2913     ** Failers
2914     b"11111
2915     a"11111
2916    
2917 ph10 461 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
2918 ph10 459 abcdX
2919     eX
2920     ** Failers
2921     abcdY
2922     ey
2923    
2924 ph10 461 /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/JDZx
2925 ph10 459 abcdd
2926     ** Failers
2927     abcdde
2928    
2929 ph10 462 /abcd*/
2930     xxxxabcd\P
2931     xxxxabcd\P\P
2932    
2933     /abcd*/i
2934     xxxxabcd\P
2935     xxxxabcd\P\P
2936     XXXXABCD\P
2937     XXXXABCD\P\P
2938    
2939     /abc\d*/
2940     xxxxabc1\P
2941     xxxxabc1\P\P
2942    
2943     /(a)bc\1*/
2944     xxxxabca\P
2945     xxxxabca\P\P
2946    
2947     /abc[de]*/
2948     xxxxabcde\P
2949     xxxxabcde\P\P
2950    
2951 ph10 1299 /-- This is not in the Perl-compatible test because Perl seems currently to be
2952 ph10 559 broken and not behaving as specified in that it *does* bumpalong after
2953     hitting (*COMMIT). --/
2954 ph10 464
2955     /(?1)(A(*COMMIT)|B)D/
2956     ABD
2957     XABD
2958     BAD
2959     ABXABD
2960     ** Failers
2961     ABX
2962     BAXBAD
2963    
2964 ph10 467 /(\3)(\1)(a)/<JS>
2965     cat
2966    
2967     /(\3)(\1)(a)/SI<JS>
2968     cat
2969    
2970     /(\3)(\1)(a)/SI
2971     cat
2972    
2973 ph10 471 /i(?(DEFINE)(?<s>a))/SI
2974     i
2975    
2976     /()i(?(1)a)/SI
2977     ia
2978    
2979 ph10 472 /(?i)a(?-i)b|c/BZ
2980     XabX
2981     XAbX
2982     CcC
2983     ** Failers
2984     XABX
2985    
2986     /(?i)a(?s)b|c/BZ
2987    
2988     /(?i)a(?s-i)b|c/BZ
2989    
2990 ph10 488 /^(ab(c\1)d|x){2}$/BZ
2991     xabcxd
2992 ph10 496
2993     /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
2994 ph10 488
2995 ph10 496 /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
2996    
2997 ph10 1299 / -- This one is here because Perl gives the match as "b" rather than "ab". I
2998 ph10 500 believe this to be a Perl bug. --/
2999    
3000     /(?>a\Kb)z|(ab)/
3001     ab
3002    
3003 ph10 504 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3004    
3005 ph10 510 /abc(*MARK:)pqr/
3006    
3007     /abc(*:)pqr/
3008    
3009     /abc(*FAIL:123)xyz/
3010    
3011     /--- This should, and does, fail. In Perl, it does not, which I think is a
3012     bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3013    
3014     /A(*COMMIT)B/+K
3015     ACABX
3016    
3017 ph10 1299 /--- These should be different, but in Perl they are not, which I think
3018 ph10 510 is a bug in Perl. ---/
3019    
3020     /A(*THEN)B|A(*THEN)C/K
3021     AC
3022    
3023     /A(*PRUNE)B|A(*PRUNE)C/K
3024     AC
3025    
3026 ph10 836 /--- Mark names can be duplicated. Perl doesn't give a mark for this one,
3027     though PCRE does. ---/
3028 ph10 510
3029     /^A(*:A)B|^X(*:A)Y/K
3030     ** Failers
3031     XAQQ
3032    
3033     /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3034     optimizations defeat this. So does the PCRE optimization unless we disable it
3035     with \Y. ---/
3036    
3037     /(*COMMIT)ABC/
3038     ABCDEFG
3039     ** Failers
3040     DEFGABC\Y
3041    
3042     /^(ab (c+(*THEN)cd) | xyz)/x
3043     abcccd
3044    
3045     /^(ab (c+(*PRUNE)cd) | xyz)/x
3046     abcccd
3047    
3048     /^(ab (c+(*FAIL)cd) | xyz)/x
3049     abcccd
3050 ph10 511
3051 ph10 1299 /--- Perl gets some of these wrong ---/
3052 ph10 510
3053 ph10 511 /(?>.(*ACCEPT))*?5/
3054     abcde
3055    
3056     /(.(*ACCEPT))*?5/
3057     abcde
3058    
3059     /(.(*ACCEPT))5/
3060     abcde
3061    
3062     /(.(*ACCEPT))*5/
3063     abcde
3064    
3065 ph10 514 /A\NB./BZ
3066 ph10 550 ACBD
3067     *** Failers
3068     A\nB
3069     ACB\n
3070 ph10 514
3071     /A\NB./sBZ
3072 ph10 550 ACBD
3073     ACB\n
3074     *** Failers
3075     A\nB
3076 ph10 514
3077     /A\NB/<crlf>
3078 ph10 550 A\nB
3079     A\rB
3080     ** Failers
3081     A\r\nB
3082 ph10 514
3083 ph10 528 /\R+b/BZ
3084    
3085     /\R+\n/BZ
3086    
3087     /\R+\d/BZ
3088    
3089     /\d*\R/BZ
3090    
3091     /\s*\R/BZ
3092 ph10 961 \x20\x0a
3093     \x20\x0d
3094     \x20\x0d\x0a
3095 ph10 528
3096 ph10 961 /\S*\R/BZ
3097     a\x0a
3098    
3099     /X\h*\R/BZ
3100     X\x20\x0a
3101    
3102     /X\H*\R/BZ
3103     X\x0d\x0a
3104    
3105     /X\H+\R/BZ
3106     X\x0d\x0a
3107    
3108     /X\H++\R/BZ
3109     X\x0d\x0a
3110    
3111 ph10 553 /(?<=abc)def/
3112     abc\P\P
3113    
3114     /abc$/
3115     abc
3116     abc\P
3117     abc\P\P
3118    
3119     /abc$/m
3120     abc
3121     abc\n
3122     abc\P\P
3123     abc\n\P\P
3124     abc\P
3125     abc\n\P
3126    
3127     /abc\z/
3128     abc
3129     abc\P
3130     abc\P\P
3131    
3132     /abc\Z/
3133     abc
3134     abc\P
3135     abc\P\P
3136    
3137     /abc\b/
3138     abc
3139     abc\P
3140     abc\P\P
3141    
3142     /abc\B/
3143     abc
3144     abc\P
3145     abc\P\P
3146    
3147 ph10 567 /.+/
3148     abc\>0
3149     abc\>1
3150     abc\>2
3151     abc\>3
3152     abc\>4
3153     abc\>-4
3154    
3155 ph10 574 /^\cģ/
3156    
3157 ph10 578 /(?P<abn>(?P=abn)xxx)/BZ
3158    
3159     /(a\1z)/BZ
3160    
3161     /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
3162    
3163     /(?P<abn>(?P=axn)xxx)/BZ
3164    
3165     /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
3166    
3167 ph10 600 /-- These tests are here because Perl gets the first one wrong. --/
3168    
3169     /(\R*)(.)/s
3170     \r\n
3171     \r\r\n\n\r
3172     \r\r\n\n\r\n
3173    
3174     /(\R)*(.)/s
3175     \r\n
3176     \r\r\n\n\r
3177     \r\r\n\n\r\n
3178    
3179     /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
3180     \r\n
3181     \r\r\n\n\r
3182     \r\r\n\n\r\n
3183    
3184     /-- --/
3185    
3186 ph10 602 /^abc$/BZ
3187    
3188     /^abc$/BZm
3189    
3190 ph10 604 /^(a)*+(\w)/S
3191     aaaaX
3192     ** Failers
3193     aaaa
3194    
3195     /^(?:a)*+(\w)/S
3196     aaaaX
3197     ** Failers
3198     aaaa
3199    
3200     /(a)++1234/SDZ
3201    
3202     /([abc])++1234/SI
3203    
3204     /(?<=(abc)+)X/
3205    
3206     /(^ab)/I
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     /(?=a)[bcd]/I
3239    
3240     /((?=a))[bcd]/I
3241    
3242     /((?=a))+[bcd]/I
3243    
3244     /((?=a))++[bcd]/I
3245    
3246     /(?=a+)[bcd]/iI
3247    
3248     /(?=a+?)[bcd]/iI
3249    
3250     /(?=a++)[bcd]/iI
3251    
3252     /(?=a{3})[bcd]/iI
3253    
3254     /(abc)\1+/S
3255    
3256 ph10 608 /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
3257    
3258     /(?1)(?:(b(*ACCEPT))){0}/
3259     b
3260    
3261     /(?1)(?:(b(*ACCEPT))){0}c/
3262     bc
3263     ** Failers
3264     b
3265    
3266     /(?1)(?:((*ACCEPT))){0}c/
3267     c
3268     c\N
3269    
3270 ph10 609 /^.*?(?(?=a)a|b(*THEN)c)/
3271     ba
3272    
3273     /^.*?(?(?=a)a|bc)/
3274     ba
3275    
3276 ph10 699 /^.*?(?(?=a)a(*THEN)b|c)/
3277     ac
3278    
3279     /^.*?(?(?=a)a(*THEN)b)c/
3280     ac
3281    
3282     /^.*?(a(*THEN)b)c/
3283     aabc
3284 ph10 713
3285     /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
3286     aabc
3287 ph10 699
3288     /^.*?(a(*THEN)b|z)c/
3289     aabc
3290    
3291     /^.*?(z|a(*THEN)b)c/
3292     aabc
3293    
3294 ph10 608 /-- --/
3295    
3296 ph10 612 /-- These studied versions are here because they are not Perl-compatible; the
3297     studying means the mark is not seen. --/
3298    
3299     /(*MARK:A)(*SKIP:B)(C|X)/KS
3300     C
3301     D
3302    
3303     /(*:A)A+(*SKIP:A)(B|Z)/KS
3304     AAAC
3305    
3306     /-- --/
3307    
3308 ph10 613 "(?=a*(*ACCEPT)b)c"
3309     c
3310     c\N
3311    
3312     /(?1)c(?(DEFINE)((*ACCEPT)b))/
3313     c
3314     c\N
3315    
3316     /(?>(*ACCEPT)b)c/
3317     c
3318     c\N
3319    
3320 ph10 618 /(?:(?>(a)))+a%/++
3321     %aa%
3322    
3323 ph10 666 /(a)b|ac/++SS
3324 ph10 618 ac\O3
3325 ph10 666
3326     /(a)(b)x|abc/++
3327     abc\O6
3328 ph10 618
3329 ph10 666 /(a)bc|(a)(b)\2/
3330     \O3abc
3331     \O4abc
3332    
3333 ph10 620 /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
3334    
3335     /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
3336    
3337     /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
3338    
3339     /(abc)(?1)/SI
3340    
3341 ph10 621 /^(?>a)++/
3342     aa\M
3343     aaaaaaaaa\M
3344    
3345     /(a)(?1)++/
3346     aa\M
3347     aaaaaaaaa\M
3348    
3349 ph10 666 /(?:(foo)|(bar)|(baz))X/SS=
3350 ph10 626 bazfooX
3351     foobazbarX
3352     barfooX
3353     bazX
3354     foobarbazX
3355     bazfooX\O0
3356     bazfooX\O2
3357     bazfooX\O4
3358     bazfooX\O6
3359     bazfooX\O8
3360     bazfooX\O10
3361    
3362 ph10 637 /(?=abc){3}abc/BZ
3363    
3364     /(?=abc)+abc/BZ
3365    
3366     /(?=abc)++abc/BZ
3367    
3368     /(?=abc){0}xyz/BZ
3369    
3370     /(?=(a))?./BZ
3371    
3372     /(?=(a))??./BZ
3373    
3374     /^(?=(a)){0}b(?1)/BZ
3375    
3376     /(?(DEFINE)(a))?b(?1)/BZ
3377    
3378     /^(?=(?1))?[az]([abc])d/BZ
3379    
3380     /^(?!a){0}\w+/BZ
3381    
3382     /(?<=(abc))?xyz/BZ
3383    
3384 ph10 666 /[:a[:abc]b:]/BZ
3385 ph10 640
3386 ph10 666 /((?2))((?1))/SS
3387 ph10 642 abc
3388    
3389 zherczeg 741 /((?(R2)a+|(?1)b))/SS
3390 ph10 642 aaaabcde
3391    
3392 zherczeg 741 /(?(R)a*(?1)|((?R))b)/SS
3393 ph10 642 aaaabcde
3394    
3395     /(a+|(?R)b)/
3396    
3397 ph10 647 /^(a(*:A)(d|e(*:B))z|aeq)/C
3398     adz
3399     aez
3400     aeqwerty
3401    
3402 ph10 648 /.(*F)/
3403     \P\Pabc
3404    
3405 ph10 657 /\btype\b\W*?\btext\b\W*?\bjavascript\b/IS
3406    
3407     /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
3408    
3409 ph10 1286 /a(*SKIP)c|b(*ACCEPT)|/+S!I
3410 ph10 697 a
3411    
3412     /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI
3413     ax
3414    
3415     'a*(*ACCEPT)b'+
3416     \N\N
3417     abc\N\N
3418     bbb\N\N
3419    
3420 ph10 701 /(*ACCEPT)a/+I
3421     bax
3422    
3423     /z(*ACCEPT)a/+I
3424     baxzbx
3425    
3426 ph10 702 /a(?:.)*?a/ims
3427     \Mabbbbbbbbbbbbbbbbbbbbba
3428 ph10 716
3429     /a(?:.(*THEN))*?a/ims
3430     \Mabbbbbbbbbbbbbbbbbbbbba
3431 ph10 702
3432 ph10 716 /a(?:.(*THEN:ABC))*?a/ims
3433     \Mabbbbbbbbbbbbbbbbbbbbba
3434    
3435 ph10 725 /^(?>a+)(?>(z+))\w/BZ
3436     aaaazzzzb
3437     ** Failers
3438     aazz
3439    
3440     /(.)(\1|a(?2))/
3441     bab
3442    
3443     /\1|(.)(?R)\1/
3444     cbbbc
3445    
3446     /(.)((?(1)c|a)|a(?2))/
3447     baa
3448    
3449     /(?P<abn>(?P=abn)xxx)/BZ
3450    
3451     /(a\1z)/BZ
3452    
3453     /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
3454     \Maabbccddee
3455    
3456     /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
3457     \Maabbccddee
3458    
3459     /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
3460     \Maabbccddee
3461    
3462 zherczeg 744 /^a\x41z/<JS>
3463     aAz
3464     *** Failers
3465     ax41z
3466    
3467     /^a[m\x41]z/<JS>
3468     aAz
3469    
3470     /^a\x1z/<JS>
3471     ax1z
3472    
3473     /^a\u0041z/<JS>
3474     aAz
3475     *** Failers
3476     au0041z
3477    
3478     /^a[m\u0041]z/<JS>
3479     aAz
3480    
3481     /^a\u041z/<JS>
3482     au041z
3483     *** Failers
3484     aAz
3485    
3486     /^a\U0041z/<JS>
3487     aU0041z
3488     *** Failers
3489     aAz
3490    
3491 ph10 749 /(?(?=c)c|d)++Y/BZ
3492    
3493     /(?(?=c)c|d)*+Y/BZ
3494    
3495 ph10 836 /a[\NB]c/
3496     aNc
3497    
3498     /a[B-\Nc]/
3499 ph10 758
3500 ph10 1392 /a[B\Nc]/
3501    
3502 ph10 836 /(a)(?2){0,1999}?(b)/
3503    
3504     /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
3505    
3506     /--- This test, with something more complicated than individual letters, causes
3507     different behaviour in Perl. Perhaps it disables some optimization; no tag is
3508     passed back for the failures, whereas in PCRE there is a tag. ---/
3509    
3510     /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
3511     AABC
3512     XXYZ
3513     ** Failers
3514     XAQQ
3515     XAQQXZZ
3516     AXQQQ
3517     AXXQQQ
3518    
3519     /-- Perl doesn't give marks for these, though it does if the alternatives are
3520     replaced by single letters. --/
3521    
3522     /(b|q)(*:m)f|a(*:n)w/K
3523     aw
3524     ** Failers
3525     abc
3526    
3527     /(q|b)(*:m)f|a(*:n)w/K
3528     aw
3529     ** Failers
3530     abc
3531    
3532     /-- After a partial match, the behaviour is as for a failure. --/
3533    
3534     /^a(*:X)bcde/K
3535     abc\P
3536 ph10 882
3537     /-- These are here because Perl doesn't return a mark, except for the first --/
3538 ph10 836
3539 ph10 882 /(?=(*:x))(q|)/K+
3540     abc
3541    
3542     /(?=(*:x))((*:y)q|)/K+
3543     abc
3544    
3545     /(?=(*:x))(?:(*:y)q|)/K+
3546     abc
3547    
3548     /(?=(*:x))(?>(*:y)q|)/K+
3549     abc
3550    
3551 ph10 888 /(?=a(*:x))(?!a(*:y)c)/K+
3552     ab
3553    
3554     /(?=a(*:x))(?=a(*:y)c|)/K+
3555     ab
3556    
3557 zherczeg 915 /(..)\1/
3558     ab\P
3559     aba\P
3560     abab\P
3561    
3562     /(..)\1/i
3563     ab\P
3564     abA\P
3565     aBAb\P
3566    
3567     /(..)\1{2,}/
3568     ab\P
3569     aba\P
3570     abab\P
3571     ababa\P
3572     ababab\P
3573     ababab\P\P
3574     abababa\P
3575     abababa\P\P
3576    
3577     /(..)\1{2,}/i
3578     ab\P
3579     aBa\P
3580     aBAb\P
3581     AbaBA\P
3582     abABAb\P
3583     aBAbaB\P\P
3584     abABabA\P
3585     abaBABa\P\P
3586    
3587     /(..)\1{2,}?x/i
3588     ab\P
3589     abA\P
3590     aBAb\P
3591     abaBA\P
3592     abAbaB\P
3593     abaBabA\P
3594     abAbABaBx\P
3595    
3596 ph10 916 /^(..)\1/
3597     aba\P
3598    
3599     /^(..)\1{2,3}x/
3600     aba\P
3601     ababa\P
3602     ababa\P\P
3603     abababx
3604     ababababx
3605    
3606     /^(..)\1{2,3}?x/
3607     aba\P
3608     ababa\P
3609     ababa\P\P
3610     abababx
3611     ababababx
3612    
3613     /^(..)(\1{2,3})ab/
3614     abababab
3615    
3616 ph10 919 /^\R/
3617     \r\P
3618     \r\P\P
3619    
3620     /^\R{2,3}x/
3621     \r\P
3622     \r\P\P
3623     \r\r\P
3624     \r\r\P\P
3625     \r\r\r\P
3626     \r\r\r\P\P
3627     \r\rx
3628     \r\r\rx
3629    
3630     /^\R{2,3}?x/
3631     \r\P
3632     \r\P\P
3633     \r\r\P
3634     \r\r\P\P
3635     \r\r\r\P
3636     \r\r\r\P\P
3637     \r\rx
3638     \r\r\rx
3639    
3640     /^\R?x/
3641     \r\P
3642     \r\P\P
3643     x
3644     \rx
3645    
3646     /^\R+x/
3647     \r\P
3648     \r\P\P
3649     \r\n\P
3650     \r\n\P\P
3651     \rx
3652    
3653     /^a$/<CRLF>
3654     a\r\P
3655     a\r\P\P
3656    
3657     /^a$/m<CRLF>
3658     a\r\P
3659     a\r\P\P
3660    
3661     /^(a$|a\r)/<CRLF>
3662     a\r\P
3663     a\r\P\P
3664    
3665     /^(a$|a\r)/m<CRLF>
3666     a\r\P
3667     a\r\P\P
3668    
3669     /./<CRLF>
3670     \r\P
3671     \r\P\P
3672    
3673     /.{2,3}/<CRLF>
3674     \r\P
3675     \r\P\P
3676     \r\r\P
3677     \r\r\P\P
3678     \r\r\r\P
3679     \r\r\r\P\P
3680    
3681     /.{2,3}?/<CRLF>
3682     \r\P
3683     \r\P\P
3684     \r\r\P
3685     \r\r\P\P
3686     \r\r\r\P
3687     \r\r\r\P\P
3688    
3689 ph10 963 "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
3690     ABCDGHI\O03
3691 ph10 972
3692 ph10 994 /-- These are all run as real matches in test 1; here we are just checking the
3693 ph10 1022 settings of the anchored and startline bits. --/
3694 ph10 963
3695 ph10 994 /(?>.*?a)(?<=ba)/I
3696    
3697     /(?:.*?a)(?<=ba)/I
3698    
3699     /.*?a(*PRUNE)b/I
3700    
3701     /.*?a(*PRUNE)b/sI
3702    
3703     /^a(*PRUNE)b/sI
3704    
3705     /.*?a(*SKIP)b/I
3706    
3707     /(?>.*?a)b/sI
3708    
3709     /(?>.*?a)b/I
3710    
3711     /(?>^a)b/sI
3712    
3713     /(?>.*?)(?<=(abcd)|(wxyz))/I
3714    
3715     /(?>.*)(?<=(abcd)|(wxyz))/I
3716    
3717     "(?>.*)foo"I
3718    
3719     "(?>.*?)foo"I
3720    
3721     /(?>^abc)/mI
3722    
3723     /(?>.*abc)/mI
3724    
3725     /(?:.*abc)/mI
3726    
3727 ph10 1022 /-- Check PCRE_STUDY_EXTRA_NEEDED --/
3728    
3729     /.?/S-I
3730    
3731     /.?/S!I
3732    
3733 ph10 1248 /(?:(a)+(?C1)bb|aa(?C2)b)/
3734     aab\C+
3735    
3736     /(?:(a)++(?C1)bb|aa(?C2)b)/
3737     aab\C+
3738    
3739     /(?:(?>(a))(?C1)bb|aa(?C2)b)/
3740     aab\C+
3741    
3742     /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
3743     aab\C+
3744    
3745     /(?1)(?C1)((a)(?C2)){0}/
3746     aab\C+
3747    
3748     /(?:(a)+(?C1)bb|aa(?C2)b)++/
3749     aab\C+
3750     aab\C+\O2
3751    
3752     /(ab)x|ab/
3753     ab\O3
3754     ab\O2
3755    
3756     /(ab)/
3757     ab\O3
3758     ab\O2
3759 ph10 1251
3760     /(?<=123)(*MARK:xx)abc/K
3761     xxxx123a\P\P
3762     xxxx123a\P
3763    
3764     /123\Kabc/
3765     xxxx123a\P\P
3766     xxxx123a\P
3767 ph10 1248
3768 ph10 1266 /^(?(?=a)aa|bb)/C
3769     bb
3770    
3771     /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
3772     bb
3773    
3774 ph10 1284 /-- Perl seems to have a bug with this one --/
3775    
3776     /aaaaa(*COMMIT)(*PRUNE)b|a+c/
3777     aaaaaac
3778 ph10 1296
3779     /-- Here are some that Perl treats differently because of the way it handles
3780     backtracking verbs. --/
3781 ph10 1284
3782 ph10 1296 /(?!a(*COMMIT)b)ac|ad/
3783     ac
3784     ad
3785    
3786     /^(?!a(*THEN)b|ac)../
3787     ac
3788     ad
3789    
3790     /^(?=a(*THEN)b|ac)/
3791     ac
3792    
3793     /\A.*?(?:a|b(*THEN)c)/
3794     ba
3795    
3796     /\A.*?(?:a|b(*THEN)c)++/
3797     ba
3798    
3799     /\A.*?(?:a|b(*THEN)c|d)/
3800     ba
3801    
3802     /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
3803     aac
3804    
3805     /\A.*?(a|b(*THEN)c)/
3806     ba
3807    
3808     /^(A(*THEN)B|A(*THEN)D)/
3809     AD
3810 ph10 1302
3811     /(?!b(*THEN)a)bn|bnn/
3812     bnn
3813 ph10 1296
3814 ph10 1302 /(?(?=b(*SKIP)a)bn|bnn)/
3815     bnn
3816    
3817     /(?=b(*THEN)a|)bn|bnn/
3818     bnn
3819    
3820 ph10 1299 /-------------------------/
3821 ph10 1296
3822 ph10 1313 /(*LIMIT_MATCH=12bc)abc/
3823    
3824     /(*LIMIT_MATCH=4294967290)abc/
3825    
3826     /(*LIMIT_RECURSION=4294967280)abc/I
3827    
3828     /(a+)*zz/
3829     aaaaaaaaaaaaaz
3830     aaaaaaaaaaaaaz\q3000
3831    
3832     /(a+)*zz/S-
3833     aaaaaaaaaaaaaz\Q10
3834    
3835     /(*LIMIT_MATCH=3000)(a+)*zz/I
3836     aaaaaaaaaaaaaz
3837     aaaaaaaaaaaaaz\q60000
3838    
3839     /(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
3840     aaaaaaaaaaaaaz
3841    
3842     /(*LIMIT_MATCH=60000)(a+)*zz/I
3843     aaaaaaaaaaaaaz
3844     aaaaaaaaaaaaaz\q3000
3845    
3846     /(*LIMIT_RECURSION=10)(a+)*zz/IS-
3847     aaaaaaaaaaaaaz
3848     aaaaaaaaaaaaaz\Q1000
3849    
3850     /(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/IS-
3851     aaaaaaaaaaaaaz
3852    
3853     /(*LIMIT_RECURSION=1000)(a+)*zz/IS-
3854     aaaaaaaaaaaaaz
3855     aaaaaaaaaaaaaz\Q10
3856    
3857 ph10 1352 /-- This test causes a segfault with Perl 5.18.0 --/
3858    
3859     /^(?=(a)){0}b(?1)/
3860     backgammon
3861    
3862 ph10 1361 /(?|(?<n>f)|(?<n>b))/JI
3863    
3864     /(?<a>abc)(?<a>z)\k<a>()/JDZS
3865    
3866 ph10 1363 /a*[bcd]/BZ
3867    
3868     /[bcd]*a/BZ
3869    
3870     /-- A complete set of tests for auto-possessification of character types --/
3871    
3872 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
3873 ph10 1363
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 /\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
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 /\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
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 /\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
3885 ph10 1363
3886 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
3887 ph10 1363
3888 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
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 /\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
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 / 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
3897 ph10 1363
3898 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
3899 ph10 1363
3900 zherczeg 1384 / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZx
3901 ph10 1363
3902 zherczeg 1384 / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZxs
3903 ph10 1363
3904 zherczeg 1384 /\D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \C+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/BZxm
3905 ph10 1363
3906 ph10 1374 /(?=a+)a(a+)++a/BZ
3907    
3908     /a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/BZ
3909    
3910     /a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/BZ
3911    
3912     /a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/BZ
3913    
3914 ph10 1379 /[ab]*/BZ
3915     aaaa
3916    
3917     /[ab]*?/BZ
3918     aaaa
3919 zherczeg 1381
3920 ph10 1379 /[ab]?/BZ
3921     aaaa
3922 zherczeg 1381
3923 ph10 1379 /[ab]??/BZ
3924     aaaa
3925 zherczeg 1381
3926 ph10 1379 /[ab]+/BZ
3927     aaaa
3928 zherczeg 1381
3929 ph10 1379 /[ab]+?/BZ
3930     aaaa
3931 zherczeg 1381
3932 ph10 1379 /[ab]{2,3}/BZ
3933     aaaa
3934 zherczeg 1381
3935 ph10 1379 /[ab]{2,3}?/BZ
3936     aaaa
3937 zherczeg 1381
3938 ph10 1379 /[ab]{2,}/BZ
3939 zherczeg 1381 aaaa
3940 ph10 1379
3941     /[ab]{2,}?/BZ
3942 zherczeg 1381 aaaa
3943 ph10 1379
3944 zherczeg 1381 /\d+\s{0,5}=\s*\S?=\w{0,4}\W*/BZ
3945    
3946 zherczeg 1382 /[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/BZ
3947    
3948     /[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
3949    
3950 zherczeg 1383 /a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/BZ
3951    
3952     /[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/BZ
3953    
3954     /[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/BZ
3955    
3956     /[a-c]*d/DZS
3957    
3958     /[a-c]+d/DZS
3959    
3960     /[a-c]?d/DZS
3961    
3962     /[a-c]{4,6}d/DZS
3963    
3964     /[a-c]{0,6}d/DZS
3965    
3966 ph10 1363 /-- End of special auto-possessive tests --/
3967    
3968 ph10 1370 /^A\o{1239}B/
3969     A\123B
3970    
3971     /^A\oB/
3972    
3973     /^A\x{zz}B/
3974    
3975     /^A\x{12Z/
3976    
3977     /^A\x{/
3978    
3979 ph10 1380 /[ab]++/BZO
3980    
3981     /[^ab]*+/BZO
3982    
3983     /a{4}+/BZO
3984    
3985     /a{4}+/BZOi
3986    
3987 ph10 1392 /[a-[:digit:]]+/
3988    
3989     /[A-[:digit:]]+/
3990    
3991     /[a-[.xxx.]]+/
3992    
3993     /[a-[=xxx=]]+/
3994    
3995     /[a-[!xxx!]]+/
3996    
3997     /[A-[!xxx!]]+/
3998     A]]]
3999    
4000     /[a-\d]+/
4001    
4002 ph10 1394 /(?<0abc>xx)/
4003    
4004     /(?&1abc)xx(?<1abc>y)/
4005    
4006     /(?<ab-cd>xx)/
4007    
4008     /(?'0abc'xx)/
4009    
4010     /(?P<0abc>xx)/
4011    
4012     /\k<5ghj>/
4013    
4014     /\k'5ghj'/
4015    
4016     /\k{2fgh}/
4017    
4018     /(?P=8yuki)/