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

Contents of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 511 - (hide annotations) (download)
Mon Mar 29 09:25:38 2010 UTC (4 years ago) by ph10
File size: 65844 byte(s)
Make (*ACCEPT) work inside an atomic group.

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     either because PCRE can't be compatible, or there is potential Perl
6     bug. --/
7    
8     /-- Originally, the Perl 5.10 things were in here too, but now I have separated
9     many (most?) of them out into test 11. However, there may still be some
10     that were overlooked. --/
11    
12 nigel 93 /(a)b|/I
13 nigel 41
14 nigel 93 /abc/I
15 nigel 41 abc
16     defabc
17     \Aabc
18     *** Failers
19     \Adefabc
20     ABC
21    
22 nigel 93 /^abc/I
23 nigel 41 abc
24     \Aabc
25     *** Failers
26     defabc
27     \Adefabc
28    
29 nigel 93 /a+bc/I
30 nigel 41
31 nigel 93 /a*bc/I
32 nigel 41
33 nigel 93 /a{3}bc/I
34 nigel 41
35 nigel 93 /(abc|a+z)/I
36 nigel 41
37 nigel 93 /^abc$/I
38 nigel 41 abc
39     *** Failers
40     def\nabc
41    
42 ph10 178 /ab\idef/X
43 nigel 41
44 ph10 178 /(?X)ab\idef/X
45 nigel 41
46     /x{5,4}/
47    
48     /z{65536}/
49    
50     /[abcd/
51    
52 nigel 63 /(?X)[\B]/
53 nigel 41
54     /[z-a]/
55    
56     /^*/
57    
58     /(abc/
59    
60     /(?# abc/
61    
62     /(?z)abc/
63    
64 nigel 93 /.*b/I
65 nigel 41
66 nigel 93 /.*?b/I
67 nigel 41
68 nigel 93 /cat|dog|elephant/I
69 nigel 41 this sentence eventually mentions a cat
70     this sentences rambles on and on for a while and then reaches elephant
71    
72 nigel 93 /cat|dog|elephant/IS
73 nigel 41 this sentence eventually mentions a cat
74     this sentences rambles on and on for a while and then reaches elephant
75    
76 nigel 93 /cat|dog|elephant/IiS
77 nigel 41 this sentence eventually mentions a CAT cat
78     this sentences rambles on and on for a while to elephant ElePhant
79    
80 nigel 93 /a|[bcd]/IS
81 nigel 41
82 nigel 93 /(a|[^\dZ])/IS
83 nigel 41
84 nigel 93 /(a|b)*[\s]/IS
85 nigel 41
86     /(ab\2)/
87    
88     /{4,5}abc/
89    
90 nigel 93 /(a)(b)(c)\2/I
91 nigel 41 abcb
92     \O0abcb
93     \O3abcb
94     \O6abcb
95     \O9abcb
96 ph10 102 \O12abcb
97 nigel 41
98 nigel 93 /(a)bc|(a)(b)\2/I
99 nigel 41 abc
100     \O0abc
101     \O3abc
102     \O6abc
103     aba
104     \O0aba
105     \O3aba
106     \O6aba
107     \O9aba
108     \O12aba
109    
110 nigel 93 /abc$/IE
111 nigel 41 abc
112     *** Failers
113     abc\n
114     abc\ndef
115    
116     /(a)(b)(c)(d)(e)\6/
117    
118 nigel 93 /the quick brown fox/I
119 nigel 41 the quick brown fox
120     this is a line with the quick brown fox
121    
122 nigel 93 /the quick brown fox/IA
123 nigel 41 the quick brown fox
124     *** Failers
125     this is a line with the quick brown fox
126    
127     /ab(?z)cd/
128    
129 nigel 93 /^abc|def/I
130 nigel 41 abcdef
131     abcdef\B
132    
133 nigel 93 /.*((abc)$|(def))/I
134 nigel 41 defabc
135     \Zdefabc
136    
137 ph10 432 /abc/P
138 nigel 41 abc
139     *** Failers
140 ph10 102
141 ph10 432 /^abc|def/P
142 nigel 41 abcdef
143     abcdef\B
144    
145 ph10 432 /.*((abc)$|(def))/P
146 nigel 41 defabc
147     \Zdefabc
148 ph10 102
149 ph10 432 /the quick brown fox/P
150 nigel 41 the quick brown fox
151 ph10 102 *** Failers
152     The Quick Brown Fox
153 nigel 41
154 ph10 432 /the quick brown fox/Pi
155 nigel 41 the quick brown fox
156 ph10 102 The Quick Brown Fox
157 nigel 41
158 ph10 432 /abc.def/P
159 nigel 41 *** Failers
160     abc\ndef
161 ph10 102
162 ph10 432 /abc$/P
163 nigel 41 abc
164 ph10 102 abc\n
165 nigel 41
166 ph10 432 /(abc)\2/P
167 nigel 41
168 ph10 432 /(abc\1)/P
169 nigel 41 abc
170    
171     /)/
172    
173     /a[]b/
174    
175 nigel 93 /[^aeiou ]{3,}/I
176 ph10 102 co-processors, and for
177    
178 nigel 93 /<.*>/I
179 nigel 41 abc<def>ghi<klm>nop
180    
181 nigel 93 /<.*?>/I
182 nigel 41 abc<def>ghi<klm>nop
183    
184 nigel 93 /<.*>/IU
185 nigel 41 abc<def>ghi<klm>nop
186 ph10 102
187 nigel 93 /(?U)<.*>/I
188 nigel 41 abc<def>ghi<klm>nop
189    
190 nigel 93 /<.*?>/IU
191 nigel 41 abc<def>ghi<klm>nop
192 ph10 102
193 nigel 93 /={3,}/IU
194 nigel 41 abc========def
195 ph10 102
196 nigel 93 /(?U)={3,}?/I
197 nigel 41 abc========def
198 ph10 102
199 nigel 93 /(?<!bar|cattle)foo/I
200 nigel 41 foo
201 ph10 102 catfoo
202 nigel 41 *** Failers
203     the barfoo
204 ph10 102 and cattlefoo
205 nigel 41
206     /(?<=a+)b/
207    
208     /(?<=aaa|b{0,3})b/
209    
210     /(?<!(foo)a\1)bar/
211    
212 nigel 93 /(?i)abc/I
213 nigel 41
214 nigel 93 /(a|(?m)a)/I
215 nigel 41
216 nigel 93 /(?i)^1234/I
217 nigel 41
218 nigel 93 /(^b|(?i)^d)/I
219 nigel 41
220 nigel 93 /(?s).*/I
221 nigel 41
222 nigel 93 /[abcd]/IS
223 nigel 41
224 nigel 93 /(?i)[abcd]/IS
225 nigel 41
226 nigel 93 /(?m)[xy]|(b|c)/IS
227 nigel 41
228 nigel 93 /(^a|^b)/Im
229 nigel 41
230 nigel 93 /(?i)(^a|^b)/Im
231 nigel 41
232     /(a)(?(1)a|b|c)/
233    
234     /(?(?=a)a|b|c)/
235    
236     /(?(1a)/
237    
238 nigel 93 /(?(1a))/
239    
240 nigel 41 /(?(?i))/
241    
242     /(?(abc))/
243    
244     /(?(?<ab))/
245    
246 nigel 93 /((?s)blah)\s+\1/I
247 nigel 41
248 nigel 93 /((?i)blah)\s+\1/I
249 nigel 41
250 ph10 161 /((?i)b)/IDZS
251 nigel 41
252 nigel 93 /(a*b|(?i:c*(?-i)d))/IS
253 nigel 41
254 nigel 93 /a$/I
255 nigel 41 a
256     a\n
257 ph10 102 *** Failers
258 nigel 41 \Za
259 ph10 102 \Za\n
260 nigel 41
261 nigel 93 /a$/Im
262 nigel 41 a
263     a\n
264 ph10 102 \Za\n
265     *** Failers
266 nigel 41 \Za
267 ph10 102
268 nigel 93 /\Aabc/Im
269 nigel 41
270 ph10 102 /^abc/Im
271 nigel 41
272 nigel 93 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
273 nigel 41 aaaaabbbbbcccccdef
274    
275 nigel 93 /(?<=foo)[ab]/IS
276 nigel 41
277 nigel 93 /(?<!foo)(alpha|omega)/IS
278 nigel 41
279 nigel 93 /(?!alphabet)[ab]/IS
280 nigel 41
281 nigel 93 /(?<=foo\n)^bar/Im
282 ph10 102 foo\nbarbar
283 nigel 75 ***Failers
284 ph10 102 rhubarb
285 nigel 75 barbell
286 ph10 102 abc\nbarton
287 nigel 41
288 nigel 93 /^(?<=foo\n)bar/Im
289 ph10 102 foo\nbarbar
290 nigel 75 ***Failers
291 ph10 102 rhubarb
292 nigel 75 barbell
293 ph10 102 abc\nbarton
294 nigel 75
295 nigel 93 /(?>^abc)/Im
296 nigel 41 abc
297     def\nabc
298     *** Failers
299 ph10 102 defabc
300 nigel 41
301     /(?<=ab(c+)d)ef/
302    
303     /(?<=ab(?<=c+)d)ef/
304    
305     /(?<=ab(c|de)f)g/
306    
307     /The next three are in testinput2 because they have variable length branches/
308    
309 nigel 93 /(?<=bullock|donkey)-cart/I
310 nigel 41 the bullock-cart
311     a donkey-cart race
312     *** Failers
313     cart
314 ph10 102 horse-and-cart
315    
316 nigel 93 /(?<=ab(?i)x|y|z)/I
317 nigel 41
318 nigel 93 /(?>.*)(?<=(abcd)|(xyz))/I
319 nigel 41 alphabetabcd
320     endingxyz
321    
322 nigel 93 /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
323 nigel 41 abxyZZ
324     abXyZZ
325     ZZZ
326     zZZ
327     bZZ
328 ph10 102 BZZ
329 nigel 41 *** Failers
330 ph10 102 ZZ
331     abXYZZ
332 nigel 41 zzz
333 ph10 102 bzz
334 nigel 41
335 nigel 93 /(?<!(foo)a)bar/I
336 nigel 41 bar
337 ph10 102 foobbar
338 nigel 41 *** Failers
339 ph10 102 fooabar
340 nigel 41
341 nigel 93 /This one is here because Perl 5.005_02 doesn't fail it/I
342 nigel 41
343 nigel 93 /^(a)?(?(1)a|b)+$/I
344 nigel 41 *** Failers
345 ph10 102 a
346 nigel 41
347 ph10 488 /This one is here because Perl behaves differently; see also the following/I
348 nigel 41
349 nigel 93 /^(a\1?){4}$/I
350 ph10 488 aaaa
351 nigel 41 aaaaaa
352 ph10 488
353     /Perl does not fail these two for the final subjects. Neither did PCRE until/
354     /release 8.01. The problem is in backtracking into a subpattern that contains/
355     /a recursive reference to itself. PCRE has now made these into atomic patterns./
356 ph10 102
357 ph10 488 /^(xa|=?\1a){2}$/
358     xa=xaa
359     ** Failers
360     xa=xaaa
361    
362     /^(xa|=?\1a)+$/
363     xa=xaa
364     ** Failers
365     xa=xaaa
366    
367 nigel 93 /These are syntax tests from Perl 5.005/I
368 nigel 41
369     /a[b-a]/
370    
371     /a[]b/
372    
373     /a[/
374    
375     /*a/
376    
377     /(*)b/
378    
379     /abc)/
380    
381     /(abc/
382    
383     /a**/
384    
385     /)(/
386    
387     /\1/
388    
389     /\2/
390    
391     /(a)|\2/
392    
393 nigel 93 /a[b-a]/Ii
394 nigel 41
395 nigel 93 /a[]b/Ii
396 nigel 41
397 nigel 93 /a[/Ii
398 nigel 41
399 nigel 93 /*a/Ii
400 nigel 41
401 nigel 93 /(*)b/Ii
402 nigel 41
403 nigel 93 /abc)/Ii
404 nigel 41
405 nigel 93 /(abc/Ii
406 nigel 41
407 nigel 93 /a**/Ii
408 nigel 41
409 nigel 93 /)(/Ii
410 nigel 41
411     /:(?:/
412    
413     /(?<%)b/
414    
415     /a(?{)b/
416    
417     /a(?{{})b/
418    
419     /a(?{}})b/
420    
421     /a(?{"{"})b/
422    
423     /a(?{"{"}})b/
424    
425     /(?(1?)a|b)/
426    
427     /[a[:xyz:/
428    
429     /(?<=x+)y/
430    
431     /a{37,17}/
432    
433     /abc/\
434    
435     /abc/\P
436    
437     /abc/\i
438    
439 nigel 93 /(a)bc(d)/I
440 nigel 41 abcd
441     abcd\C2
442     abcd\C5
443 ph10 102
444 nigel 93 /(.{20})/I
445 nigel 41 abcdefghijklmnopqrstuvwxyz
446     abcdefghijklmnopqrstuvwxyz\C1
447     abcdefghijklmnopqrstuvwxyz\G1
448 ph10 102
449 nigel 93 /(.{15})/I
450 nigel 41 abcdefghijklmnopqrstuvwxyz
451     abcdefghijklmnopqrstuvwxyz\C1\G1
452    
453 nigel 93 /(.{16})/I
454 nigel 41 abcdefghijklmnopqrstuvwxyz
455     abcdefghijklmnopqrstuvwxyz\C1\G1\L
456 ph10 102
457 nigel 93 /^(a|(bc))de(f)/I
458 ph10 102 adef\G1\G2\G3\G4\L
459     bcdef\G1\G2\G3\G4\L
460     adefghijk\C0
461    
462 nigel 93 /^abc\00def/I
463 ph10 102 abc\00def\L\C0
464    
465     /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
466     )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
467 ph10 162 )?)?)?)?)?)?)?)?)?otherword/I
468 nigel 41
469 ph10 161 /.*X/IDZ
470 nigel 41
471 ph10 161 /.*X/IDZs
472 nigel 41
473 ph10 161 /(.*X|^B)/IDZ
474 nigel 41
475 ph10 161 /(.*X|^B)/IDZs
476 ph10 102
477 ph10 161 /(?s)(.*X|^B)/IDZ
478 nigel 41
479 ph10 161 /(?s:.*X|^B)/IDZ
480 nigel 41
481 nigel 93 /\Biss\B/I+
482 nigel 41 Mississippi
483    
484 nigel 93 /\Biss\B/I+P
485 nigel 41 Mississippi
486    
487 nigel 93 /iss/IG+
488 nigel 41 Mississippi
489    
490 nigel 93 /\Biss\B/IG+
491 nigel 41 Mississippi
492    
493 nigel 93 /\Biss\B/Ig+
494 nigel 41 Mississippi
495     *** Failers
496     Mississippi\A
497    
498 nigel 93 /(?<=[Ms])iss/Ig+
499 nigel 41 Mississippi
500    
501 nigel 93 /(?<=[Ms])iss/IG+
502 nigel 41 Mississippi
503    
504 nigel 93 /^iss/Ig+
505 nigel 41 ississippi
506 ph10 102
507 nigel 93 /.*iss/Ig+
508 ph10 102 abciss\nxyzisspqr
509 nigel 41
510 nigel 93 /.i./I+g
511 nigel 41 Mississippi
512     Mississippi\A
513     Missouri river
514 ph10 102 Missouri river\A
515 nigel 41
516 nigel 93 /^.is/I+g
517 nigel 41 Mississippi
518    
519 nigel 93 /^ab\n/Ig+
520 nigel 41 ab\nab\ncd
521    
522 nigel 93 /^ab\n/Img+
523 nigel 41 ab\nab\ncd
524    
525 nigel 93 /abc/I
526 nigel 41
527 nigel 93 /abc|bac/I
528 nigel 41
529 nigel 93 /(abc|bac)/I
530 nigel 41
531 nigel 93 /(abc|(c|dc))/I
532 nigel 41
533 nigel 93 /(abc|(d|de)c)/I
534 nigel 41
535 nigel 93 /a*/I
536 nigel 41
537 nigel 93 /a+/I
538 nigel 41
539 nigel 93 /(baa|a+)/I
540 nigel 41
541 nigel 93 /a{0,3}/I
542 nigel 41
543 nigel 93 /baa{3,}/I
544 nigel 41
545 nigel 93 /"([^\\"]+|\\.)*"/I
546 nigel 41
547 nigel 93 /(abc|ab[cd])/I
548 nigel 41
549 nigel 93 /(a|.)/I
550 nigel 41
551 nigel 93 /a|ba|\w/I
552 nigel 41
553 nigel 93 /abc(?=pqr)/I
554 nigel 41
555 nigel 93 /...(?<=abc)/I
556 nigel 41
557 nigel 93 /abc(?!pqr)/I
558 nigel 41
559 nigel 93 /ab./I
560 nigel 41
561 nigel 93 /ab[xyz]/I
562 nigel 41
563 nigel 93 /abc*/I
564 nigel 41
565 nigel 93 /ab.c*/I
566 nigel 41
567 nigel 93 /a.c*/I
568 nigel 41
569 nigel 93 /.c*/I
570 nigel 41
571 nigel 93 /ac*/I
572 nigel 41
573 nigel 93 /(a.c*|b.c*)/I
574 nigel 41
575 nigel 93 /a.c*|aba/I
576 nigel 41
577 nigel 93 /.+a/I
578 nigel 41
579 nigel 93 /(?=abcda)a.*/I
580 nigel 41
581 nigel 93 /(?=a)a.*/I
582 nigel 41
583 nigel 93 /a(b)*/I
584 nigel 41
585 nigel 93 /a\d*/I
586 nigel 41
587 nigel 93 /ab\d*/I
588 nigel 41
589 nigel 93 /a(\d)*/I
590 nigel 41
591 nigel 93 /abcde{0,0}/I
592 nigel 41
593 nigel 93 /ab\d+/I
594 nigel 41
595 ph10 270 /a(?(1)b)(.)/I
596 nigel 41
597 ph10 270 /a(?(1)bag|big)(.)/I
598 nigel 41
599 ph10 270 /a(?(1)bag|big)*(.)/I
600 nigel 41
601 ph10 270 /a(?(1)bag|big)+(.)/I
602 nigel 41
603 ph10 270 /a(?(1)b..|b..)(.)/I
604 nigel 41
605 nigel 93 /ab\d{0}e/I
606 nigel 41
607 nigel 93 /a?b?/I
608 nigel 41 a
609     b
610     ab
611     \
612     *** Failers
613 ph10 102 \N
614    
615 nigel 93 /|-/I
616 nigel 41 abcd
617     -abc
618     \Nab-c
619     *** Failers
620 ph10 102 \Nabc
621 nigel 41
622 ph10 432 /a*(b+)(z)(z)/P
623 nigel 41 aaaabbbbzzzz
624     aaaabbbbzzzz\O0
625     aaaabbbbzzzz\O1
626     aaaabbbbzzzz\O2
627     aaaabbbbzzzz\O3
628     aaaabbbbzzzz\O4
629     aaaabbbbzzzz\O5
630    
631 ph10 102 /^.?abcd/IS
632    
633 nigel 43 /\( # ( at start
634     (?: # Non-capturing bracket
635     (?>[^()]+) # Either a sequence of non-brackets (no backtracking)
636     | # Or
637     (?R) # Recurse - i.e. nested bracketed string
638     )* # Zero or more contents
639     \) # Closing )
640 nigel 93 /Ix
641 nigel 43 (abcd)
642     (abcd)xyz
643     xyz(abcd)
644 ph10 102 (ab(xy)cd)pqr
645     (ab(xycd)pqr
646     () abc ()
647 nigel 43 12(abcde(fsh)xyz(foo(bar))lmno)89
648     *** Failers
649 ph10 102 abcd
650 nigel 43 abcd)
651 ph10 102 (abcd
652 nigel 43
653 nigel 93 /\( ( (?>[^()]+) | (?R) )* \) /Ixg
654 ph10 102 (ab(xy)cd)pqr
655 nigel 43 1(abcd)(x(y)z)pqr
656    
657 nigel 93 /\( (?: (?>[^()]+) | (?R) ) \) /Ix
658 nigel 43 (abcd)
659     (ab(xy)cd)
660 ph10 102 (a(b(c)d)e)
661     ((ab))
662 nigel 43 *** Failers
663 ph10 102 ()
664 nigel 43
665 nigel 93 /\( (?: (?>[^()]+) | (?R) )? \) /Ix
666 nigel 43 ()
667     12(abcde(fsh)xyz(foo(bar))lmno)89
668    
669 nigel 93 /\( ( (?>[^()]+) | (?R) )* \) /Ix
670 nigel 43 (ab(xy)cd)
671    
672 nigel 93 /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
673 nigel 43 (ab(xy)cd)
674    
675 nigel 93 /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
676 nigel 43 (ab(xy)cd)
677     (123ab(xy)cd)
678    
679 nigel 93 /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
680 nigel 43 (ab(xy)cd)
681     (123ab(xy)cd)
682    
683 nigel 93 /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
684 nigel 43 (ab(xy)cd)
685    
686 nigel 93 /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
687 nigel 43 (abcd(xyz<p>qrs)123)
688    
689 nigel 93 /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
690 nigel 43 (ab(cd)ef)
691     (ab(cd(ef)gh)ij)
692    
693 ph10 161 /^[[:alnum:]]/DZ
694 nigel 43
695 ph10 161 /^[[:^alnum:]]/DZ
696 nigel 75
697 ph10 161 /^[[:alpha:]]/DZ
698 nigel 75
699 ph10 161 /^[[:^alpha:]]/DZ
700 ph10 102
701 nigel 87 /[_[:alpha:]]/IS
702    
703 ph10 161 /^[[:ascii:]]/DZ
704 nigel 43
705 ph10 161 /^[[:^ascii:]]/DZ
706 nigel 75
707 ph10 161 /^[[:blank:]]/DZ
708 nigel 63
709 ph10 161 /^[[:^blank:]]/DZ
710 nigel 87
711     /[\n\x0b\x0c\x0d[:blank:]]/IS
712    
713 ph10 161 /^[[:cntrl:]]/DZ
714 nigel 43
715 ph10 161 /^[[:digit:]]/DZ
716 nigel 43
717 ph10 161 /^[[:graph:]]/DZ
718 nigel 43
719 ph10 161 /^[[:lower:]]/DZ
720 nigel 43
721 ph10 161 /^[[:print:]]/DZ
722 nigel 43
723 ph10 161 /^[[:punct:]]/DZ
724 nigel 43
725 ph10 161 /^[[:space:]]/DZ
726 nigel 43
727 ph10 161 /^[[:upper:]]/DZ
728 nigel 43
729 ph10 161 /^[[:xdigit:]]/DZ
730 nigel 43
731 ph10 161 /^[[:word:]]/DZ
732 nigel 43
733 ph10 161 /^[[:^cntrl:]]/DZ
734 nigel 43
735 ph10 161 /^[12[:^digit:]]/DZ
736 nigel 43
737 ph10 161 /^[[:^blank:]]/DZ
738 nigel 63
739 ph10 161 /[01[:alpha:]%]/DZ
740 nigel 43
741 nigel 93 /[[.ch.]]/I
742 nigel 43
743 nigel 93 /[[=ch=]]/I
744 nigel 43
745 nigel 93 /[[:rhubarb:]]/I
746 nigel 43
747 nigel 93 /[[:upper:]]/Ii
748 nigel 43 A
749 ph10 102 a
750    
751 nigel 93 /[[:lower:]]/Ii
752 nigel 43 A
753 ph10 102 a
754 nigel 43
755 nigel 93 /((?-i)[[:lower:]])[[:lower:]]/Ii
756 nigel 43 ab
757     aB
758     *** Failers
759     Ab
760 ph10 102 AB
761 nigel 43
762 nigel 93 /[\200-\110]/I
763 nigel 49
764 nigel 93 /^(?(0)f|b)oo/I
765 nigel 51
766 nigel 93 /This one's here because of the large output vector needed/I
767 nigel 53
768 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
769 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
770    
771 nigel 93 /This one's here because Perl does this differently and PCRE can't at present/I
772 nigel 53
773 nigel 93 /(main(O)?)+/I
774 nigel 53 mainmain
775     mainOmain
776 ph10 102
777 nigel 93 /These are all cases where Perl does it differently (nested captures)/I
778 nigel 63
779 nigel 93 /^(a(b)?)+$/I
780 nigel 63 aba
781 ph10 102
782 nigel 93 /^(aa(bb)?)+$/I
783 ph10 102 aabbaa
784    
785 nigel 93 /^(aa|aa(bb))+$/I
786 ph10 102 aabbaa
787    
788 nigel 93 /^(aa(bb)??)+$/I
789 ph10 102 aabbaa
790    
791 nigel 93 /^(?:aa(bb)?)+$/I
792 ph10 102 aabbaa
793    
794 nigel 93 /^(aa(b(b))?)+$/I
795 ph10 102 aabbaa
796 nigel 63
797 nigel 93 /^(?:aa(b(b))?)+$/I
798 ph10 102 aabbaa
799 nigel 63
800 nigel 93 /^(?:aa(b(?:b))?)+$/I
801 ph10 102 aabbaa
802 nigel 63
803 nigel 93 /^(?:aa(bb(?:b))?)+$/I
804 ph10 102 aabbbaa
805    
806 nigel 93 /^(?:aa(b(?:bb))?)+$/I
807 ph10 102 aabbbaa
808 nigel 63
809 nigel 93 /^(?:aa(?:b(b))?)+$/I
810 ph10 102 aabbaa
811 nigel 63
812 nigel 93 /^(?:aa(?:b(bb))?)+$/I
813 ph10 102 aabbbaa
814 nigel 63
815 nigel 93 /^(aa(b(bb))?)+$/I
816 ph10 102 aabbbaa
817 nigel 63
818 nigel 93 /^(aa(bb(bb))?)+$/I
819 ph10 102 aabbbbaa
820 nigel 63
821 ph10 102 /--------------------------------------------------------------------/I
822    
823 ph10 162 /#/IxDZ
824 nigel 63
825 ph10 162 /a#/IxDZ
826 nigel 63
827 ph10 161 /[\s]/DZ
828 nigel 63
829 ph10 161 /[\S]/DZ
830 nigel 63
831 ph10 161 /a(?i)b/DZ
832 nigel 63 ab
833     aB
834 ph10 102 *** Failers
835     AB
836 nigel 63
837 ph10 161 /(a(?i)b)/DZ
838 nigel 63 ab
839     aB
840 ph10 102 *** Failers
841     AB
842    
843 ph10 161 / (?i)abc/IxDZ
844 nigel 63
845     /#this is a comment
846 ph10 161 (?i)abc/IxDZ
847 nigel 63
848 ph10 161 /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
849 nigel 63
850 ph10 161 /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
851 nigel 63
852 ph10 161 /\Q\E/DZ
853 nigel 63 \
854    
855 ph10 161 /\Q\Ex/DZ
856 nigel 63
857 ph10 161 / \Q\E/DZ
858 nigel 63
859 ph10 161 /a\Q\E/DZ
860 nigel 63 abc
861     bca
862 ph10 102 bac
863 nigel 63
864 ph10 161 /a\Q\Eb/DZ
865 nigel 63 abc
866    
867 ph10 161 /\Q\Eabc/DZ
868 nigel 63
869 ph10 161 /x*+\w/DZ
870 nigel 63 *** Failers
871     xxxxx
872 ph10 102
873 ph10 161 /x?+/DZ
874 nigel 63
875 ph10 161 /x++/DZ
876 nigel 63
877 ph10 161 /x{1,3}+/DZ
878 nigel 63
879 ph10 161 /(x)*+/DZ
880 nigel 63
881 nigel 93 /^(\w++|\s++)*$/I
882 nigel 63 now is the time for all good men to come to the aid of the party
883     *** Failers
884     this is not a line with only words and spaces!
885 ph10 102
886 nigel 93 /(\d++)(\w)/I
887 nigel 63 12345a
888     *** Failers
889 ph10 102 12345+
890 nigel 63
891 nigel 93 /a++b/I
892 nigel 63 aaab
893    
894 nigel 93 /(a++b)/I
895 nigel 63 aaab
896    
897 nigel 93 /(a++)b/I
898 nigel 63 aaab
899    
900 nigel 93 /([^()]++|\([^()]*\))+/I
901 nigel 63 ((abc(ade)ufh()()x
902 ph10 102
903     /\(([^()]++|\([^()]+\))+\)/I
904 nigel 63 (abc)
905     (abc(def)xyz)
906     *** Failers
907 ph10 102 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
908 nigel 63
909 ph10 161 /(abc){1,3}+/DZ
910 nigel 63
911 nigel 93 /a+?+/I
912 nigel 63
913 nigel 93 /a{2,3}?+b/I
914 nigel 63
915 nigel 93 /(?U)a+?+/I
916 nigel 63
917 nigel 93 /a{2,3}?+b/IU
918 nigel 63
919 ph10 161 /x(?U)a++b/DZ
920 nigel 63 xaaaab
921    
922 ph10 161 /(?U)xa++b/DZ
923 nigel 63 xaaaab
924    
925 ph10 161 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/DZ
926 nigel 63
927 ph10 161 /^x(?U)a+b/DZ
928 nigel 63
929 ph10 161 /^x(?U)(a+)b/DZ
930 nigel 63
931 nigel 93 /[.x.]/I
932 nigel 63
933 nigel 93 /[=x=]/I
934 nigel 63
935 nigel 93 /[:x:]/I
936 nigel 63
937 nigel 93 /\l/I
938 nigel 63
939 nigel 93 /\L/I
940 nigel 63
941 nigel 93 /\N{name}/I
942 nigel 63
943 nigel 93 /\u/I
944 nigel 63
945 nigel 93 /\U/I
946 nigel 63
947 nigel 93 /[/I
948 nigel 63
949 nigel 93 /[a-/I
950 nigel 63
951 nigel 93 /[[:space:]/I
952 nigel 63
953 ph10 162 /[\s]/IDZ
954 nigel 63
955 ph10 162 /[[:space:]]/IDZ
956 nigel 63
957 ph10 162 /[[:space:]abcde]/IDZ
958 nigel 63
959 nigel 93 /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
960 nigel 63 <>
961     <abcd>
962     <abc <123> hij>
963     <abc <def> hij>
964 ph10 102 <abc<>def>
965     <abc<>
966 nigel 63 *** Failers
967     <abc
968    
969 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
970 nigel 63
971 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
972 nigel 63
973     /(.*)\d+\1/I
974    
975     /(.*)\d+/I
976 ph10 102
977 nigel 63 /(.*)\d+\1/Is
978    
979     /(.*)\d+/Is
980    
981     /(.*(xyz))\d+\2/I
982    
983     /((.*))\d+\1/I
984     abc123bc
985 ph10 102
986 nigel 63 /a[b]/I
987    
988     /(?=a).*/I
989    
990 nigel 93 /(?=abc).xyz/IiI
991 nigel 63
992     /(?=abc)(?i).xyz/I
993    
994     /(?=a)(?=b)/I
995    
996     /(?=.)a/I
997    
998     /((?=abcda)a)/I
999    
1000     /((?=abcda)ab)/I
1001    
1002     /()a/I
1003    
1004 ph10 270 /(?(1)ab|ac)(.)/I
1005 nigel 63
1006 ph10 270 /(?(1)abz|acz)(.)/I
1007 nigel 63
1008 ph10 270 /(?(1)abz)(.)/I
1009 nigel 63
1010 ph10 270 /(?(1)abz)(1)23/I
1011 nigel 63
1012     /(a)+/I
1013    
1014     /(a){2,3}/I
1015    
1016     /(a)*/I
1017    
1018     /[a]/I
1019    
1020     /[ab]/I
1021    
1022     /[ab]/IS
1023    
1024     /[^a]/I
1025    
1026     /\d456/I
1027    
1028     /\d456/IS
1029    
1030     /a^b/I
1031    
1032 nigel 93 /^a/Im
1033 nigel 63 abcde
1034 ph10 102 xy\nabc
1035     *** Failers
1036     xyabc
1037 nigel 63
1038     /c|abc/I
1039    
1040     /(?i)[ab]/IS
1041    
1042     /[ab](?i)cd/IS
1043    
1044 nigel 93 /abc(?C)def/I
1045 nigel 63 abcdef
1046 ph10 102 1234abcdef
1047 nigel 63 *** Failers
1048     abcxyz
1049 ph10 102 abcxyzf
1050 nigel 63
1051 nigel 93 /abc(?C)de(?C1)f/I
1052 nigel 63 123abcdef
1053 ph10 102
1054     /(?C1)\dabc(?C2)def/I
1055 nigel 63 1234abcdef
1056     *** Failers
1057 ph10 102 abcdef
1058    
1059 nigel 93 /(?C255)ab/I
1060 nigel 63
1061 nigel 93 /(?C256)ab/I
1062 nigel 63
1063 ph10 102 /(?Cab)xx/I
1064 nigel 63
1065 nigel 93 /(?C12vr)x/I
1066 nigel 63
1067 nigel 93 /abc(?C)def/I
1068 nigel 63 *** Failers
1069     \x83\x0\x61bcdef
1070    
1071 nigel 93 /(abc)(?C)de(?C1)f/I
1072 nigel 63 123abcdef
1073 ph10 102 123abcdef\C+
1074     123abcdef\C-
1075 nigel 63 *** Failers
1076 ph10 102 123abcdef\C!1
1077    
1078 nigel 93 /(?C0)(abc(?C1))*/I
1079 nigel 63 abcabcabc
1080 ph10 102 abcabc\C!1!3
1081 nigel 63 *** Failers
1082 ph10 102 abcabcabc\C!1!3
1083 nigel 63
1084 nigel 93 /(\d{3}(?C))*/I
1085 nigel 63 123\C+
1086     123456\C+
1087 ph10 102 123456789\C+
1088 nigel 63
1089 nigel 93 /((xyz)(?C)p|(?C1)xyzabc)/I
1090 nigel 63 xyzabc\C+
1091    
1092 nigel 93 /(X)((xyz)(?C)p|(?C1)xyzabc)/I
1093 nigel 63 Xxyzabc\C+
1094    
1095 nigel 93 /(?=(abc))(?C)abcdef/I
1096 nigel 63 abcdef\C+
1097 ph10 102
1098 nigel 93 /(?!(abc)(?C1)d)(?C2)abcxyz/I
1099 ph10 102 abcxyz\C+
1100 nigel 63
1101 nigel 93 /(?<=(abc)(?C))xyz/I
1102 nigel 63 abcxyz\C+
1103 ph10 102
1104 nigel 93 /a(b+)(c*)(?C1)/I
1105 nigel 77 abbbbbccc\C*1
1106    
1107 nigel 93 /a(b+?)(c*?)(?C1)/I
1108 nigel 77 abbbbbccc\C*1
1109 nigel 63
1110 ph10 102 /(?C)abc/I
1111    
1112 nigel 93 /(?C)^abc/I
1113 nigel 63
1114 nigel 93 /(?C)a|b/IS
1115 nigel 63
1116 nigel 93 /(?R)/I
1117 nigel 63
1118 nigel 93 /(a|(?R))/I
1119 nigel 63
1120 nigel 93 /(ab|(bc|(de|(?R))))/I
1121 nigel 63
1122 nigel 93 /x(ab|(bc|(de|(?R))))/I
1123 nigel 63 xab
1124     xbc
1125     xde
1126     xxab
1127     xxxab
1128     *** Failers
1129 ph10 102 xyab
1130 nigel 63
1131 nigel 93 /(ab|(bc|(de|(?1))))/I
1132 nigel 63
1133 nigel 93 /x(ab|(bc|(de|(?1)x)x)x)/I
1134 nigel 63
1135 nigel 93 /^([^()]|\((?1)*\))*$/I
1136 nigel 63 abc
1137     a(b)c
1138 ph10 102 a(b(c))d
1139 nigel 63 *** Failers)
1140 ph10 102 a(b(c)d
1141 nigel 63
1142 nigel 93 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
1143 nigel 63 >abc>123<xyz<
1144     >abc>1(2)3<xyz<
1145     >abc>(1(2)3)<xyz<
1146    
1147 ph10 161 /(a(?1)b)/DZ
1148 nigel 63
1149 ph10 161 /(a(?1)+b)/DZ
1150 nigel 63
1151 nigel 93 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
1152 nigel 63 12
1153     (((2+2)*-3)-7)
1154     -12
1155     *** Failers
1156     ((2+2)*-3)-7)
1157 ph10 102
1158 nigel 93 /^(x(y|(?1){2})z)/I
1159 nigel 63 xyz
1160 ph10 102 xxyzxyzz
1161 nigel 63 *** Failers
1162     xxyzz
1163 ph10 102 xxyzxyzxyzz
1164 nigel 63
1165 nigel 93 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
1166 nigel 63 <>
1167     <abcd>
1168     <abc <123> hij>
1169     <abc <def> hij>
1170 ph10 102 <abc<>def>
1171     <abc<>
1172 nigel 63 *** Failers
1173     <abc
1174    
1175 nigel 93 /(?1)/I
1176 nigel 63
1177 nigel 93 /((?2)(abc)/I
1178 nigel 63
1179 nigel 93 /^(abc)def(?1)/I
1180 nigel 63 abcdefabc
1181    
1182 nigel 93 /^(a|b|c)=(?1)+/I
1183 nigel 63 a=a
1184     a=b
1185 ph10 102 a=bc
1186 nigel 63
1187 nigel 93 /^(a|b|c)=((?1))+/I
1188 nigel 63 a=a
1189     a=b
1190 ph10 102 a=bc
1191 nigel 63
1192 ph10 161 /a(?P<name1>b|c)d(?P<longername2>e)/DZ
1193 nigel 63 abde
1194 ph10 102 acde
1195 nigel 63
1196 ph10 161 /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/DZ
1197 nigel 63
1198 ph10 161 /(?P<a>a)...(?P=a)bbb(?P>a)d/DZ
1199 nigel 63
1200 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
1201 nigel 63 1221
1202     Satan, oscillate my metallic sonatas!
1203     A man, a plan, a canal: Panama!
1204 ph10 102 Able was I ere I saw Elba.
1205 nigel 63 *** Failers
1206 ph10 102 The quick brown fox
1207    
1208 nigel 93 /((?(R)a|b))\1(?1)?/I
1209 nigel 63 bb
1210 ph10 102 bbaa
1211 nigel 63
1212 nigel 93 /(.*)a/Is
1213 nigel 63
1214 nigel 93 /(.*)a\1/Is
1215 nigel 63
1216 nigel 93 /(.*)a(b)\2/Is
1217 nigel 63
1218 nigel 93 /((.*)a|(.*)b)z/Is
1219 nigel 63
1220 nigel 93 /((.*)a|(.*)b)z\1/Is
1221 nigel 63
1222 nigel 93 /((.*)a|(.*)b)z\2/Is
1223 nigel 63
1224 nigel 93 /((.*)a|(.*)b)z\3/Is
1225 nigel 63
1226 nigel 93 /((.*)a|^(.*)b)z\3/Is
1227 nigel 63
1228 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
1229 nigel 63
1230 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
1231 nigel 63
1232 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
1233 nigel 63
1234 ph10 161 /(a)(bc)/INDZ
1235 nigel 63 abc
1236    
1237 ph10 161 /(?P<one>a)(bc)/INDZ
1238 nigel 63 abc
1239    
1240 ph10 161 /(a)(?P<named>bc)/INDZ
1241 nigel 63
1242 nigel 93 /(a+)*zz/I
1243 nigel 63 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
1244     aaaaaaaaaaaaaz\M
1245    
1246 nigel 93 /(aaa(?C1)bbb|ab)/I
1247 nigel 63 aaabbb
1248     aaabbb\C*0
1249     aaabbb\C*1
1250     aaabbb\C*-1
1251    
1252 nigel 93 /ab(?P<one>cd)ef(?P<two>gh)/I
1253 nigel 63 abcdefgh
1254     abcdefgh\C1\Gtwo
1255     abcdefgh\Cone\Ctwo
1256 ph10 102 abcdefgh\Cthree
1257 nigel 63
1258 ph10 161 /(?P<Tes>)(?P<Test>)/DZ
1259 nigel 63
1260 ph10 161 /(?P<Test>)(?P<Tes>)/DZ
1261 nigel 63
1262 nigel 93 /(?P<Z>zz)(?P<A>aa)/I
1263 nigel 63 zzaa\CZ
1264     zzaa\CA
1265    
1266 nigel 93 /(?P<x>eks)(?P<x>eccs)/I
1267 nigel 65
1268 nigel 93 /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
1269 nigel 65
1270 nigel 93 "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
1271 nigel 73 [10,20,30,5,5,4,4,2,43,23,4234]
1272     *** Failers
1273 ph10 102 []
1274 nigel 73
1275 nigel 93 "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
1276 nigel 73 [10,20,30,5,5,4,4,2,43,23,4234]
1277 ph10 102 []
1278 nigel 73
1279 ph10 161 /(a(b(?2)c))?/DZ
1280 nigel 73
1281 ph10 161 /(a(b(?2)c))*/DZ
1282 nigel 73
1283 ph10 161 /(a(b(?2)c)){0,2}/DZ
1284 nigel 73
1285 ph10 161 /[ab]{1}+/DZ
1286 nigel 73
1287 nigel 93 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
1288 nigel 73 Baby Bjorn Active Carrier - With free SHIPPING!!
1289    
1290 nigel 93 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS
1291 nigel 73 Baby Bjorn Active Carrier - With free SHIPPING!!
1292 ph10 102
1293 ph10 161 /a*.*b/ISDZ
1294 nigel 73
1295 ph10 161 /(a|b)*.?c/ISDZ
1296 nigel 73
1297 ph10 161 /abc(?C255)de(?C)f/DZ
1298 nigel 75
1299 ph10 161 /abcde/ICDZ
1300 nigel 75 abcde
1301 ph10 102 abcdfe
1302    
1303 ph10 161 /a*b/ICDZ
1304 nigel 75 ab
1305     aaaab
1306 ph10 102 aaaacb
1307 nigel 75
1308 ph10 161 /a+b/ICDZ
1309 nigel 75 ab
1310     aaaab
1311 ph10 102 aaaacb
1312 nigel 75
1313 ph10 161 /(abc|def)x/ICDZ
1314 nigel 75 abcx
1315     defx
1316     abcdefzx
1317    
1318 nigel 93 /(ab|cd){3,4}/IC
1319 nigel 75 ababab
1320     abcdabcd
1321 ph10 102 abcdcdcdcdcd
1322 nigel 75
1323 ph10 161 /([ab]{,4}c|xy)/ICDZ
1324 nigel 75 Note: that { does NOT introduce a quantifier
1325    
1326 ph10 161 /([ab]{1,4}c|xy){4,5}?123/ICDZ
1327 nigel 75 aacaacaacaacaac123
1328    
1329     /\b.*/I
1330     ab cd\>1
1331 ph10 102
1332     /\b.*/Is
1333 nigel 75 ab cd\>1
1334 ph10 102
1335 nigel 75 /(?!.bcd).*/I
1336 ph10 102 Xbcd12345
1337 nigel 75
1338 nigel 93 /abcde/I
1339 nigel 75 ab\P
1340     abc\P
1341     abcd\P
1342 ph10 102 abcde\P
1343 nigel 75 the quick brown abc\P
1344     ** Failers\P
1345     the quick brown abxyz fox\P
1346 ph10 102
1347 nigel 93 "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
1348 nigel 75 13/05/04\P
1349     13/5/2004\P
1350 ph10 102 02/05/09\P
1351 nigel 75 1\P
1352     1/2\P
1353     1/2/0\P
1354 ph10 102 1/2/04\P
1355 nigel 75 0\P
1356     02/\P
1357 ph10 102 02/0\P
1358 nigel 75 02/1\P
1359     ** Failers\P
1360     \P
1361     123\P
1362     33/4/04\P
1363     3/13/04\P
1364     0/1/2003\P
1365 ph10 102 0/\P
1366     02/0/\P
1367     02/13\P
1368 nigel 75
1369     /0{0,2}ABC/I
1370 ph10 102
1371 nigel 75 /\d{3,}ABC/I
1372 ph10 102
1373 nigel 75 /\d*ABC/I
1374    
1375     /[abc]+DE/I
1376    
1377 nigel 93 /[abc]?123/I
1378 nigel 75 123\P
1379     a\P
1380     b\P
1381     c\P
1382     c12\P
1383 ph10 102 c123\P
1384 nigel 75
1385 nigel 93 /^(?:\d){3,5}X/I
1386 nigel 75 1\P
1387     123\P
1388     123X
1389     1234\P
1390     1234X
1391     12345\P
1392 ph10 102 12345X
1393     *** Failers
1394     1X
1395     123456\P
1396 nigel 75
1397 nigel 93 /abc/I>testsavedregex
1398 nigel 75 <testsavedregex
1399     abc
1400     ** Failers
1401     bca
1402 ph10 102
1403 nigel 93 /abc/IF>testsavedregex
1404 nigel 75 <testsavedregex
1405     abc
1406     ** Failers
1407     bca
1408    
1409 nigel 93 /(a|b)/IS>testsavedregex
1410 nigel 75 <testsavedregex
1411     abc
1412     ** Failers
1413 ph10 102 def
1414    
1415 nigel 93 /(a|b)/ISF>testsavedregex
1416 nigel 75 <testsavedregex
1417     abc
1418     ** Failers
1419 ph10 102 def
1420    
1421 nigel 93 ~<(\w+)/?>(.)*</(\1)>~smgI
1422 nigel 75 <!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>
1423    
1424     /^a/IF
1425    
1426 nigel 93 /line\nbreak/I
1427 nigel 77 this is a line\nbreak
1428 ph10 102 line one\nthis is a line\nbreak in the second line
1429 nigel 77
1430 nigel 93 /line\nbreak/If
1431 nigel 77 this is a line\nbreak
1432 ph10 102 ** Failers
1433     line one\nthis is a line\nbreak in the second line
1434 nigel 77
1435 nigel 93 /line\nbreak/Imf
1436 nigel 77 this is a line\nbreak
1437 ph10 102 ** Failers
1438     line one\nthis is a line\nbreak in the second line
1439 nigel 77
1440 ph10 432 /ab.cd/P
1441 nigel 77 ab-cd
1442 ph10 102 ab=cd
1443 nigel 77 ** Failers
1444     ab\ncd
1445    
1446 ph10 432 /ab.cd/Ps
1447 nigel 77 ab-cd
1448 ph10 102 ab=cd
1449 nigel 77 ab\ncd
1450    
1451 nigel 93 /(?i)(?-i)AbCd/I
1452 nigel 79 AbCd
1453     ** Failers
1454 ph10 102 abcd
1455    
1456 nigel 93 /a{11111111111111111111}/I
1457 nigel 79
1458 nigel 93 /(){64294967295}/I
1459 nigel 81
1460 nigel 93 /(){2,4294967295}/I
1461 nigel 81
1462 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
1463 nigel 81 abcdefghijklAkB
1464    
1465 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
1466 nigel 81 abcdefghijklAkB
1467    
1468 nigel 93 "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
1469 nigel 81 abcdefghijklAkB
1470    
1471 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
1472 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1473    
1474 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
1475 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1476    
1477 nigel 93 /[^()]*(?:\((?R)\)[^()]*)*/I
1478 nigel 87 (this(and)that
1479 ph10 102 (this(and)that)
1480 nigel 87 (this(and)that)stuff
1481    
1482 nigel 93 /[^()]*(?:\((?>(?R))\)[^()]*)*/I
1483 nigel 87 (this(and)that
1484 ph10 102 (this(and)that)
1485    
1486 nigel 93 /[^()]*(?:\((?R)\))*[^()]*/I
1487 nigel 87 (this(and)that
1488 ph10 102 (this(and)that)
1489 nigel 87
1490 nigel 93 /(?:\((?R)\))*[^()]*/I
1491 nigel 87 (this(and)that
1492 ph10 102 (this(and)that)
1493     ((this))
1494 nigel 87
1495 nigel 93 /(?:\((?R)\))|[^()]*/I
1496 nigel 87 (this(and)that
1497 ph10 102 (this(and)that)
1498 nigel 87 (this)
1499 ph10 102 ((this))
1500    
1501 ph10 432 /a(b)c/PN
1502 nigel 87 abc
1503 ph10 102
1504 ph10 432 /a(?P<name>b)c/PN
1505 ph10 102 abc
1506 nigel 87
1507 ph10 102 /\x{100}/I
1508    
1509 nigel 93 /\x{0000ff}/I
1510 nigel 87
1511 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/I
1512 nigel 91
1513 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1514 nigel 91 a1b\CA
1515 ph10 102 a2b\CA
1516 nigel 91 ** Failers
1517 ph10 102 a1b\CZ\CA
1518    
1519 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1520 nigel 91 ab\CA
1521 ph10 102
1522 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1523 nigel 91 ab\CA
1524 ph10 102 cd\CA
1525    
1526 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1527 ph10 102 cdefgh\CA
1528    
1529 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1530 nigel 91 a1b\GA
1531 ph10 102 a2b\GA
1532 nigel 91 ** Failers
1533 ph10 102 a1b\GZ\GA
1534    
1535 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1536 nigel 91 ab\GA
1537 ph10 102
1538 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1539 nigel 91 ab\GA
1540 ph10 102 cd\GA
1541    
1542 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1543 ph10 102 cdefgh\GA
1544    
1545 nigel 93 /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
1546 nigel 91 a1b\CA
1547 ph10 102 a2b\CA
1548    
1549 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
1550 nigel 91
1551     / In this next test, J is not set at the outer level; consequently it isn't
1552 ph10 102 set in the pattern's options; consequently pcre_get_named_substring() produces
1553 nigel 93 a random value. /Ix
1554 nigel 91
1555 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
1556 nigel 91 a bc d\CA\CB\CC
1557    
1558 nigel 93 /^(?P<A>a)?(?(A)a|b)/I
1559 nigel 91 aabc
1560     bc
1561     ** Failers
1562 ph10 102 abc
1563 nigel 91
1564 nigel 93 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
1565 nigel 91 bXaX
1566    
1567 nigel 93 /(?:(?(2y)a|b)(X))+/I
1568 nigel 91
1569 nigel 93 /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
1570 nigel 91
1571 nigel 93 /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
1572 nigel 91 bbXaaX
1573    
1574 nigel 93 /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
1575 nigel 91 (b)\\Xa\\X
1576    
1577 nigel 93 /(?P<ABC/I
1578 nigel 91
1579 nigel 93 /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1580 nigel 91 bXXaYYaY
1581 ph10 102 bXYaXXaX
1582 nigel 91
1583 nigel 93 /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1584 nigel 91 bXXaYYaY
1585    
1586 nigel 93 /\777/I
1587 nigel 91
1588 nigel 93 /\s*,\s*/IS
1589 nigel 91 \x0b,\x0b
1590 ph10 102 \x0c,\x0d
1591 nigel 91
1592 nigel 93 /^abc/Im
1593 nigel 91 xyz\nabc
1594     xyz\nabc\<lf>
1595     xyz\r\nabc\<lf>
1596     xyz\rabc\<cr>
1597     xyz\r\nabc\<crlf>
1598 ph10 102 ** Failers
1599 nigel 91 xyz\nabc\<cr>
1600     xyz\r\nabc\<cr>
1601     xyz\nabc\<crlf>
1602     xyz\rabc\<crlf>
1603     xyz\rabc\<lf>
1604 ph10 102
1605 nigel 93 /abc$/Im<lf>
1606 nigel 91 xyzabc
1607 ph10 102 xyzabc\n
1608     xyzabc\npqr
1609     xyzabc\r\<cr>
1610     xyzabc\rpqr\<cr>
1611     xyzabc\r\n\<crlf>
1612     xyzabc\r\npqr\<crlf>
1613 nigel 91 ** Failers
1614 ph10 102 xyzabc\r
1615     xyzabc\rpqr
1616     xyzabc\r\n
1617     xyzabc\r\npqr
1618    
1619 nigel 93 /^abc/Im<cr>
1620 nigel 91 xyz\rabcdef
1621     xyz\nabcdef\<lf>
1622 ph10 102 ** Failers
1623 nigel 91 xyz\nabcdef
1624 ph10 102
1625 nigel 93 /^abc/Im<lf>
1626 nigel 91 xyz\nabcdef
1627     xyz\rabcdef\<cr>
1628 ph10 102 ** Failers
1629 nigel 91 xyz\rabcdef
1630 ph10 102
1631 nigel 93 /^abc/Im<crlf>
1632 nigel 91 xyz\r\nabcdef
1633     xyz\rabcdef\<cr>
1634 ph10 102 ** Failers
1635 nigel 91 xyz\rabcdef
1636 ph10 102
1637 nigel 93 /^abc/Im<bad>
1638 nigel 91
1639 nigel 93 /abc/I
1640 nigel 91 xyz\rabc\<bad>
1641 ph10 102 abc
1642    
1643 nigel 93 /.*/I<lf>
1644 nigel 91 abc\ndef
1645     abc\rdef
1646     abc\r\ndef
1647     \<cr>abc\ndef
1648     \<cr>abc\rdef
1649     \<cr>abc\r\ndef
1650     \<crlf>abc\ndef
1651     \<crlf>abc\rdef
1652     \<crlf>abc\r\ndef
1653    
1654 nigel 93 /\w+(.)(.)?def/Is
1655 nigel 91 abc\ndef
1656     abc\rdef
1657     abc\r\ndef
1658    
1659 nigel 93 +((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I
1660 nigel 91 /* this is a C style comment */\M
1661    
1662 nigel 93 /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
1663 nigel 91
1664 nigel 93 /()()()()()()()()()()()()()()()()()()()()
1665     ()()()()()()()()()()()()()()()()()()()()
1666     ()()()()()()()()()()()()()()()()()()()()
1667     ()()()()()()()()()()()()()()()()()()()()
1668     ()()()()()()()()()()()()()()()()()()()()
1669     (.(.))/Ix
1670 ph10 102 XY\O400
1671 nigel 93
1672     /(a*b|(?i:c*(?-i)d))/IS
1673    
1674     /()[ab]xyz/IS
1675    
1676     /(|)[ab]xyz/IS
1677    
1678     /(|c)[ab]xyz/IS
1679    
1680     /(|c?)[ab]xyz/IS
1681    
1682     /(d?|c?)[ab]xyz/IS
1683    
1684     /(d?|c)[ab]xyz/IS
1685    
1686 ph10 161 /^a*b\d/DZ
1687 nigel 93
1688 ph10 161 /^a*+b\d/DZ
1689 nigel 93
1690 ph10 161 /^a*?b\d/DZ
1691 nigel 93
1692 ph10 161 /^a+A\d/DZ
1693 nigel 93 aaaA5
1694     ** Failers
1695 ph10 102 aaaa5
1696 nigel 93
1697 ph10 161 /^a*A\d/IiDZ
1698 nigel 93 aaaA5
1699     aaaa5
1700    
1701     /(a*|b*)[cd]/IS
1702    
1703     /(a+|b*)[cd]/IS
1704    
1705     /(a*|b+)[cd]/IS
1706    
1707     /(a+|b+)[cd]/IS
1708    
1709     /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1710     ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1711     (((
1712     a
1713     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1714     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1715 ph10 102 )))
1716     /Ix
1717 nigel 93 large nest
1718    
1719 ph10 162 /a*\d/BZ
1720 nigel 93
1721 ph10 162 /a*\D/BZ
1722 nigel 93
1723 ph10 162 /0*\d/BZ
1724 nigel 93
1725 ph10 162 /0*\D/BZ
1726 nigel 93
1727 ph10 162 /a*\s/BZ
1728 nigel 93
1729 ph10 162 /a*\S/BZ
1730 nigel 93
1731 ph10 162 / *\s/BZ
1732 nigel 93
1733 ph10 162 / *\S/BZ
1734 nigel 93
1735 ph10 162 /a*\w/BZ
1736 nigel 93
1737 ph10 162 /a*\W/BZ
1738 nigel 93
1739 ph10 162 /=*\w/BZ
1740 nigel 93
1741 ph10 162 /=*\W/BZ
1742 nigel 93
1743 ph10 162 /\d*a/BZ
1744 nigel 93
1745 ph10 162 /\d*2/BZ
1746 nigel 93
1747 ph10 162 /\d*\d/BZ
1748 nigel 93
1749 ph10 162 /\d*\D/BZ
1750 nigel 93
1751 ph10 162 /\d*\s/BZ
1752 nigel 93
1753 ph10 162 /\d*\S/BZ
1754 nigel 93
1755 ph10 162 /\d*\w/BZ
1756 nigel 93
1757 ph10 162 /\d*\W/BZ
1758 nigel 93
1759 ph10 162 /\D*a/BZ
1760 nigel 93
1761 ph10 162 /\D*2/BZ
1762 nigel 93
1763 ph10 162 /\D*\d/BZ
1764 nigel 93
1765 ph10 162 /\D*\D/BZ
1766 nigel 93
1767 ph10 162 /\D*\s/BZ
1768 nigel 93
1769 ph10 162 /\D*\S/BZ
1770 nigel 93
1771 ph10 162 /\D*\w/BZ
1772 nigel 93
1773 ph10 162 /\D*\W/BZ
1774 nigel 93
1775 ph10 162 /\s*a/BZ
1776 nigel 93
1777 ph10 162 /\s*2/BZ
1778 nigel 93
1779 ph10 162 /\s*\d/BZ
1780 nigel 93
1781 ph10 162 /\s*\D/BZ
1782 nigel 93
1783 ph10 162 /\s*\s/BZ
1784 nigel 93
1785 ph10 162 /\s*\S/BZ
1786 nigel 93
1787 ph10 162 /\s*\w/BZ
1788 nigel 93
1789 ph10 162 /\s*\W/BZ
1790 nigel 93
1791 ph10 162 /\S*a/BZ
1792 nigel 93
1793 ph10 162 /\S*2/BZ
1794 nigel 93
1795 ph10 162 /\S*\d/BZ
1796 nigel 93
1797 ph10 162 /\S*\D/BZ
1798 nigel 93
1799 ph10 162 /\S*\s/BZ
1800 nigel 93
1801 ph10 162 /\S*\S/BZ
1802 nigel 93
1803 ph10 162 /\S*\w/BZ
1804 nigel 93
1805 ph10 162 /\S*\W/BZ
1806 nigel 93
1807 ph10 162 /\w*a/BZ
1808 nigel 93
1809 ph10 162 /\w*2/BZ
1810 nigel 93
1811 ph10 162 /\w*\d/BZ
1812 nigel 93
1813 ph10 162 /\w*\D/BZ
1814 nigel 93
1815 ph10 162 /\w*\s/BZ
1816 nigel 93
1817 ph10 162 /\w*\S/BZ
1818 nigel 93
1819 ph10 162 /\w*\w/BZ
1820 nigel 93
1821 ph10 162 /\w*\W/BZ
1822 nigel 93
1823 ph10 162 /\W*a/BZ
1824 nigel 93
1825 ph10 162 /\W*2/BZ
1826 nigel 93
1827 ph10 162 /\W*\d/BZ
1828 nigel 93
1829 ph10 162 /\W*\D/BZ
1830 nigel 93
1831 ph10 162 /\W*\s/BZ
1832 nigel 93
1833 ph10 162 /\W*\S/BZ
1834 nigel 93
1835 ph10 162 /\W*\w/BZ
1836 nigel 93
1837 ph10 162 /\W*\W/BZ
1838 nigel 93
1839 ph10 162 /[^a]+a/BZ
1840 nigel 93
1841 ph10 162 /[^a]+a/BZi
1842 nigel 93
1843 ph10 162 /[^a]+A/BZi
1844 nigel 93
1845 ph10 162 /[^a]+b/BZ
1846 nigel 93
1847 ph10 162 /[^a]+\d/BZ
1848 nigel 93
1849 ph10 162 /a*[^a]/BZ
1850 nigel 93
1851     /(?P<abc>x)(?P<xyz>y)/I
1852     xy\Cabc\Cxyz
1853    
1854     /(?<abc>x)(?'xyz'y)/I
1855     xy\Cabc\Cxyz
1856    
1857     /(?<abc'x)(?'xyz'y)/I
1858    
1859     /(?<abc>x)(?'xyz>y)/I
1860    
1861     /(?P'abc'x)(?P<xyz>y)/I
1862    
1863     /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
1864     bXaX
1865     bXbX
1866     ** Failers
1867 ph10 102 aXaX
1868     aXbX
1869 nigel 93
1870     /^(?P>abc)(?<abcd>xxx)/
1871    
1872     /^(?P>abc)(?<abc>x|y)/
1873     xx
1874     xy
1875     yy
1876 ph10 102 yx
1877 nigel 93
1878     /^(?P>abc)(?P<abc>x|y)/
1879     xx
1880     xy
1881     yy
1882 ph10 102 yx
1883 nigel 93
1884     /^((?(abc)a|b)(?<abc>x|y))+/
1885     bxay
1886 ph10 102 bxby
1887 nigel 93 ** Failers
1888 ph10 102 axby
1889 nigel 93
1890     /^(((?P=abc)|X)(?<abc>x|y))+/
1891     XxXxxx
1892     XxXyyx
1893     XxXyxx
1894     ** Failers
1895 ph10 102 x
1896 nigel 93
1897     /^(?1)(abc)/
1898     abcabc
1899    
1900     /^(?:(?:\1|X)(a|b))+/
1901     Xaaa
1902 ph10 102 Xaba
1903 nigel 93
1904 ph10 162 /^[\E\Qa\E-\Qz\E]+/BZ
1905 ph10 102
1906 ph10 162 /^[a\Q]bc\E]/BZ
1907 ph10 102
1908 ph10 162 /^[a-\Q\E]/BZ
1909 nigel 93
1910 ph10 162 /^(?P>abc)[()](?<abc>)/BZ
1911 nigel 93
1912 ph10 162 /^((?(abc)y)[()](?P<abc>x))+/BZ
1913 nigel 93 (xy)x
1914    
1915 ph10 162 /^(?P>abc)\Q()\E(?<abc>)/BZ
1916 nigel 93
1917 ph10 162 /^(?P>abc)[a\Q(]\E(](?<abc>)/BZ
1918 ph10 102
1919 nigel 93 /^(?P>abc) # this is (a comment)
1920 ph10 162 (?<abc>)/BZx
1921 nigel 93
1922     /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
1923     1221
1924     Satan, oscillate my metallic sonatas!
1925     A man, a plan, a canal: Panama!
1926 ph10 102 Able was I ere I saw Elba.
1927 nigel 93 *** Failers
1928 ph10 102 The quick brown fox
1929    
1930 nigel 93 /(?=(\w+))\1:/I
1931     abcd:
1932    
1933     /(?=(?'abc'\w+))\k<abc>:/I
1934     abcd:
1935    
1936     /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
1937     adaa
1938     ** Failers
1939     addd
1940 ph10 102 adbb
1941 nigel 93
1942     /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/J
1943     bdaa
1944     bdab
1945     ** Failers
1946 ph10 102 bddd
1947 nigel 93
1948     /(?(<bc))/
1949    
1950 ph10 102 /(?(''))/
1951 nigel 93
1952     /(?('R')stuff)/
1953    
1954     /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
1955     abcabc1Xabc2XabcXabcabc
1956    
1957     /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1958     abcabc1Xabc2XabcXabcabc
1959    
1960     /(?<A> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1961    
1962     /(?<1> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1963     abcabc1Xabc2XabcXabcabc
1964    
1965     /^(?(DEFINE) abc | xyz ) /x
1966 ph10 102
1967 nigel 93 /(?(DEFINE) abc) xyz/xI
1968    
1969     /(?(DEFINE) abc){3} xyz/x
1970    
1971     /(a|)*\d/
1972     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1973     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
1974    
1975     /^a.b/<lf>
1976     a\rb
1977 ph10 102 a\nb\<cr>
1978 ph10 149 a\x85b\<anycrlf>
1979 nigel 93 ** Failers
1980     a\nb
1981     a\nb\<any>
1982 ph10 102 a\rb\<cr>
1983     a\rb\<any>
1984 ph10 149 a\x85b\<any>
1985     a\rb\<anycrlf>
1986 nigel 93
1987     /^abc./mgx<any>
1988 ph10 355 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
1989 nigel 93
1990     /abc.$/mgx<any>
1991 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
1992 nigel 93
1993     /a/<cr><any>
1994    
1995     /a/<any><crlf>
1996    
1997 ph10 247 /^a\Rb/<bsr_unicode>
1998 nigel 93 a\nb
1999     a\rb
2000     a\r\nb
2001     a\x0bb
2002     a\x0cb
2003 ph10 102 a\x85b
2004 nigel 93 ** Failers
2005 ph10 102 a\n\rb
2006 nigel 93
2007 ph10 247 /^a\R*b/<bsr_unicode>
2008 nigel 93 ab
2009     a\nb
2010     a\rb
2011     a\r\nb
2012     a\x0bb
2013     a\x0cb
2014 ph10 102 a\x85b
2015     a\n\rb
2016     a\n\r\x85\x0cb
2017 nigel 93
2018 ph10 247 /^a\R+b/<bsr_unicode>
2019 nigel 93 a\nb
2020     a\rb
2021     a\r\nb
2022     a\x0bb
2023     a\x0cb
2024 ph10 102 a\x85b
2025     a\n\rb
2026     a\n\r\x85\x0cb
2027 nigel 93 ** Failers
2028 ph10 102 ab
2029    
2030 ph10 247 /^a\R{1,3}b/<bsr_unicode>
2031 nigel 93 a\nb
2032     a\n\rb
2033     a\n\r\x85b
2034 ph10 102 a\r\n\r\nb
2035     a\r\n\r\n\r\nb
2036 nigel 93 a\n\r\n\rb
2037 ph10 102 a\n\n\r\nb
2038 nigel 93 ** Failers
2039     a\n\n\n\rb
2040     a\r
2041    
2042 ph10 247 /^a[\R]b/<bsr_unicode>
2043 nigel 93 aRb
2044     ** Failers
2045 ph10 102 a\nb
2046 nigel 93
2047     /(?&abc)X(?<abc>P)/I
2048     abcPXP123
2049    
2050     /(?1)X(?<abc>P)/I
2051     abcPXP123
2052    
2053     /(?:a(?&abc)b)*(?<abc>x)/
2054     123axbaxbaxbx456
2055     123axbaxbaxb456
2056 ph10 102
2057 nigel 93 /(?:a(?&abc)b){1,5}(?<abc>x)/
2058     123axbaxbaxbx456
2059    
2060     /(?:a(?&abc)b){2,5}(?<abc>x)/
2061     123axbaxbaxbx456
2062    
2063     /(?:a(?&abc)b){2,}(?<abc>x)/
2064     123axbaxbaxbx456
2065    
2066     /(abc)(?i:(?1))/
2067     defabcabcxyz
2068     DEFabcABCXYZ
2069    
2070     /(abc)(?:(?i)(?1))/
2071     defabcabcxyz
2072     DEFabcABCXYZ
2073    
2074     /^(a)\g-2/
2075    
2076     /^(a)\g/
2077    
2078     /^(a)\g{0}/
2079    
2080     /^(a)\g{3/
2081    
2082     /^(a)\g{4a}/
2083    
2084     /^a.b/<lf>
2085     a\rb
2086     *** Failers
2087     a\nb
2088    
2089     /.+foo/
2090     afoo
2091 ph10 102 ** Failers
2092     \r\nfoo
2093     \nfoo
2094 nigel 93
2095     /.+foo/<crlf>
2096     afoo
2097 ph10 102 \nfoo
2098     ** Failers
2099     \r\nfoo
2100 nigel 93
2101     /.+foo/<any>
2102     afoo
2103 ph10 102 ** Failers
2104     \nfoo
2105     \r\nfoo
2106 nigel 93
2107     /.+foo/s
2108     afoo
2109 ph10 102 \r\nfoo
2110     \nfoo
2111 ph10 131
2112     /^$/mg<any>
2113     abc\r\rxyz
2114     abc\n\rxyz
2115     ** Failers
2116     abc\r\nxyz
2117 nigel 93
2118 ph10 141 /(?m)^$/<any>g+
2119     abc\r\n\r\n
2120    
2121 ph10 143 /(?m)^$|^\r\n/<any>g+
2122     abc\r\n\r\n
2123    
2124     /(?m)$/<any>g+
2125     abc\r\n\r\n
2126    
2127 ph10 149 /abc.$/mgx<anycrlf>
2128 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
2129 ph10 149
2130 ph10 155 /^X/m
2131     XABC
2132     ** Failers
2133     XABC\B
2134    
2135 ph10 174 /(ab|c)(?-1)/BZ
2136 ph10 166 abc
2137    
2138 ph10 174 /xy(?+1)(abc)/BZ
2139 ph10 166 xyabcabc
2140     ** Failers
2141     xyabc
2142    
2143     /x(?-0)y/
2144    
2145     /x(?-1)y/
2146    
2147     /x(?+0)y/
2148    
2149     /x(?+1)y/
2150    
2151 ph10 174 /^(abc)?(?(-1)X|Y)/BZ
2152 ph10 167 abcX
2153     Y
2154     ** Failers
2155     abcY
2156    
2157 ph10 174 /^((?(+1)X|Y)(abc))+/BZ
2158 ph10 167 YabcXabc
2159     YabcXabcXabc
2160     ** Failers
2161     XabcXabc
2162    
2163 ph10 174 /(?(-1)a)/BZ
2164 ph10 167
2165 ph10 174 /((?(-1)a))/BZ
2166 ph10 167
2167 ph10 174 /((?(-2)a))/BZ
2168 ph10 167
2169 ph10 270 /^(?(+1)X|Y)(.)/BZ
2170     Y!
2171 ph10 167
2172 ph10 171 /(?<A>tom|bon)-\k{A}/
2173     tom-tom
2174     bon-bon
2175     ** Failers
2176     tom-bon
2177    
2178     /\g{A/
2179    
2180 ph10 175 /(?|(abc)|(xyz))/BZ
2181     >abc<
2182     >xyz<
2183    
2184     /(x)(?|(abc)|(xyz))(x)/BZ
2185     xabcx
2186     xxyzx
2187    
2188     /(x)(?|(abc)(pqr)|(xyz))(x)/BZ
2189     xabcpqrx
2190     xxyzx
2191    
2192 ph10 178 /[\h]/BZ
2193     >\x09<
2194    
2195     /[\h]+/BZ
2196     >\x09\x20\xa0<
2197    
2198     /[\v]/BZ
2199    
2200     /[\H]/BZ
2201    
2202     /[^\h]/BZ
2203    
2204     /[\V]/BZ
2205    
2206     /[\x0a\V]/BZ
2207    
2208 ph10 180 /\H++X/BZ
2209     ** Failers
2210     XXXX
2211    
2212     /\H+\hY/BZ
2213     XXXX Y
2214    
2215     /\H+ Y/BZ
2216    
2217     /\h+A/BZ
2218    
2219     /\v*B/BZ
2220    
2221     /\V+\x0a/BZ
2222    
2223     /A+\h/BZ
2224    
2225     / *\H/BZ
2226    
2227     /A*\v/BZ
2228    
2229     /\x0b*\V/BZ
2230    
2231     /\d+\h/BZ
2232    
2233     /\d*\v/BZ
2234    
2235     /S+\h\S+\v/BZ
2236    
2237     /\w{3,}\h\w+\v/BZ
2238    
2239     /\h+\d\h+\w\h+\S\h+\H/BZ
2240    
2241     /\v+\d\v+\w\v+\S\v+\V/BZ
2242    
2243     /\H+\h\H+\d/BZ
2244    
2245     /\V+\v\V+\w/BZ
2246    
2247 ph10 197 /\( (?: [^()]* | (?R) )* \)/x
2248     (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(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)
2249    
2250 ph10 205 /[\E]AAA/
2251    
2252     /[\Q\E]AAA/
2253    
2254     /[^\E]AAA/
2255    
2256     /[^\Q\E]AAA/
2257    
2258     /[\E^]AAA/
2259    
2260     /[\Q\E^]AAA/
2261    
2262 ph10 210 /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ
2263    
2264     /^a+(*FAIL)/C
2265     aaaaaa
2266    
2267     /a+b?c+(*FAIL)/C
2268     aaabccc
2269    
2270     /a+b?(*PRUNE)c+(*FAIL)/C
2271     aaabccc
2272    
2273     /a+b?(*COMMIT)c+(*FAIL)/C
2274     aaabccc
2275    
2276     /a+b?(*SKIP)c+(*FAIL)/C
2277     aaabcccaaabccc
2278    
2279     /a+b?(*THEN)c+(*FAIL)/C
2280     aaabccc
2281    
2282     /a(*MARK)b/
2283    
2284 ph10 213 /(?i:A{1,}\6666666666)/
2285    
2286     /\g6666666666/
2287    
2288     /[\g6666666666]/
2289    
2290 ph10 215 /(?1)\c[/
2291    
2292 ph10 226 /.+A/<crlf>
2293     \r\nA
2294    
2295     /\nA/<crlf>
2296     \r\nA
2297    
2298     /[\r\n]A/<crlf>
2299     \r\nA
2300    
2301     /(\r|\n)A/<crlf>
2302     \r\nA
2303    
2304 ph10 227 /a(*CR)b/
2305    
2306     /(*CR)a.b/
2307     a\nb
2308     ** Failers
2309     a\rb
2310    
2311     /(*CR)a.b/<lf>
2312     a\nb
2313     ** Failers
2314     a\rb
2315    
2316     /(*LF)a.b/<CRLF>
2317     a\rb
2318     ** Failers
2319     a\nb
2320    
2321     /(*CRLF)a.b/
2322     a\rb
2323     a\nb
2324     ** Failers
2325     a\r\nb
2326    
2327     /(*ANYCRLF)a.b/<CR>
2328     ** Failers
2329     a\rb
2330     a\nb
2331     a\r\nb
2332    
2333     /(*ANY)a.b/<cr>
2334     ** Failers
2335     a\rb
2336     a\nb
2337     a\r\nb
2338     a\x85b
2339    
2340 ph10 231 /a\Rb/I<bsr_anycrlf>
2341     a\rb
2342     a\nb
2343     a\r\nb
2344     ** Failers
2345     a\x85b
2346     a\x0bb
2347    
2348     /a\Rb/I<bsr_unicode>
2349     a\rb
2350     a\nb
2351     a\r\nb
2352     a\x85b
2353     a\x0bb
2354     ** Failers
2355     a\x85b\<bsr_anycrlf>
2356     a\x0bb\<bsr_anycrlf>
2357    
2358     /a\R?b/I<bsr_anycrlf>
2359     a\rb
2360     a\nb
2361     a\r\nb
2362     ** Failers
2363     a\x85b
2364     a\x0bb
2365    
2366     /a\R?b/I<bsr_unicode>
2367     a\rb
2368     a\nb
2369     a\r\nb
2370     a\x85b
2371     a\x0bb
2372     ** Failers
2373     a\x85b\<bsr_anycrlf>
2374     a\x0bb\<bsr_anycrlf>
2375    
2376     /a\R{2,4}b/I<bsr_anycrlf>
2377     a\r\n\nb
2378     a\n\r\rb
2379     a\r\n\r\n\r\n\r\nb
2380     ** Failers
2381     a\x85\85b
2382     a\x0b\0bb
2383    
2384     /a\R{2,4}b/I<bsr_unicode>
2385     a\r\rb
2386     a\n\n\nb
2387     a\r\n\n\r\rb
2388     a\x85\85b
2389     a\x0b\0bb
2390     ** Failers
2391     a\r\r\r\r\rb
2392     a\x85\85b\<bsr_anycrlf>
2393     a\x0b\0bb\<bsr_anycrlf>
2394    
2395     /(*BSR_ANYCRLF)a\Rb/I
2396     a\nb
2397     a\rb
2398    
2399     /(*BSR_UNICODE)a\Rb/I
2400     a\x85b
2401    
2402     /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
2403     a\nb
2404     a\rb
2405    
2406     /(*CRLF)(*BSR_UNICODE)a\Rb/I
2407     a\x85b
2408    
2409     /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
2410    
2411 ph10 268 /(?<a>)(?&)/
2412    
2413     /(?<abc>)(?&a)/
2414    
2415     /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
2416    
2417 ph10 269 /(?+-a)/
2418    
2419     /(?-+a)/
2420    
2421 ph10 271 /(?(-1))/
2422    
2423     /(?(+10))/
2424    
2425     /(?(10))/
2426    
2427     /(?(+2))()()/
2428    
2429     /(?(2))()()/
2430    
2431 ph10 272 /\k''/
2432    
2433     /\k<>/
2434    
2435     /\k{}/
2436    
2437     /(?P=)/
2438    
2439     /(?P>)/
2440    
2441 ph10 282 /(?!\w)(?R)/
2442    
2443     /(?=\w)(?R)/
2444    
2445     /(?<!\w)(?R)/
2446    
2447     /(?<=\w)(?R)/
2448    
2449 ph10 295 /[[:foo:]]/
2450    
2451     /[[:1234:]]/
2452    
2453     /[[:f\oo:]]/
2454    
2455     /[[: :]]/
2456    
2457     /[[:...:]]/
2458    
2459     /[[:l\ower:]]/
2460    
2461     /[[:abc\:]]/
2462    
2463     /[abc[:x\]pqr:]]/
2464    
2465     /[[:a\dz:]]/
2466    
2467 ph10 333 /(^(a|b\g<-1'c))/
2468    
2469 ph10 335 /^(?+1)(?<a>x|y){0}z/
2470     xzxx
2471     yzyy
2472     ** Failers
2473     xxz
2474    
2475 ph10 336 /(\3)(\1)(a)/
2476     cat
2477    
2478     /(\3)(\1)(a)/<JS>
2479     cat
2480    
2481     /TA]/
2482     The ACTA] comes
2483    
2484     /TA]/<JS>
2485     The ACTA] comes
2486    
2487 ph10 340 /(?2)[]a()b](abc)/
2488     abcbabc
2489    
2490     /(?2)[^]a()b](abc)/
2491     abcbabc
2492    
2493     /(?1)[]a()b](abc)/
2494     abcbabc
2495     ** Failers
2496     abcXabc
2497    
2498     /(?1)[^]a()b](abc)/
2499     abcXabc
2500     ** Failers
2501     abcbabc
2502    
2503     /(?2)[]a()b](abc)(xyz)/
2504     xyzbabcxyz
2505    
2506     /(?&N)[]a(?<N>)](?<M>abc)/
2507     abc<abc
2508    
2509     /(?&N)[]a(?<N>)](abc)/
2510     abc<abc
2511    
2512 ph10 341 /a[]b/
2513    
2514     /a[^]b/
2515    
2516     /a[]b/<JS>
2517     ** Failers
2518     ab
2519    
2520     /a[]+b/<JS>
2521     ** Failers
2522     ab
2523    
2524     /a[]*+b/<JS>
2525     ** Failers
2526     ab
2527    
2528     /a[^]b/<JS>
2529     aXb
2530     a\nb
2531     ** Failers
2532     ab
2533    
2534     /a[^]+b/<JS>
2535     aXb
2536     a\nX\nXb
2537     ** Failers
2538     ab
2539    
2540     /a(?!)+b/
2541    
2542     /a(*FAIL)+b/
2543    
2544 ph10 353 /(abc|pqr|123){0}[xyz]/SI
2545    
2546 ph10 381 /(?(?=.*b)b|^)/CI
2547     adc
2548     abc
2549    
2550     /(?(?=b).*b|^d)/I
2551    
2552     /(?(?=.*b).*b|^d)/I
2553    
2554 ph10 388 /a?|b?/P
2555     abc
2556     ** Failers
2557     ddd\N
2558    
2559 ph10 389 /xyz/C
2560     xyz
2561     abcxyz
2562     abcxyz\Y
2563     ** Failers
2564     abc
2565     abc\Y
2566     abcxypqr
2567     abcxypqr\Y
2568    
2569 ph10 399 /^"((?(?=[a])[^"])|b)*"$/C
2570     "ab"
2571    
2572     /^"((?(?=[a])[^"])|b)*"$/
2573     "ab"
2574    
2575 ph10 408 /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
2576     XYabcdY
2577    
2578     /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
2579     XYabcdY
2580    
2581 ph10 426 /Xa{2,4}b/
2582     X\P
2583     Xa\P
2584     Xaa\P
2585     Xaaa\P
2586     Xaaaa\P
2587    
2588     /Xa{2,4}?b/
2589     X\P
2590     Xa\P
2591     Xaa\P
2592     Xaaa\P
2593     Xaaaa\P
2594    
2595     /Xa{2,4}+b/
2596     X\P
2597     Xa\P
2598     Xaa\P
2599     Xaaa\P
2600     Xaaaa\P
2601    
2602     /X\d{2,4}b/
2603     X\P
2604     X3\P
2605     X33\P
2606     X333\P
2607     X3333\P
2608    
2609     /X\d{2,4}?b/
2610     X\P
2611     X3\P
2612     X33\P
2613     X333\P
2614     X3333\P
2615    
2616     /X\d{2,4}+b/
2617     X\P
2618     X3\P
2619     X33\P
2620     X333\P
2621     X3333\P
2622    
2623     /X\D{2,4}b/
2624     X\P
2625     Xa\P
2626     Xaa\P
2627     Xaaa\P
2628     Xaaaa\P
2629    
2630     /X\D{2,4}?b/
2631     X\P
2632     Xa\P
2633     Xaa\P
2634     Xaaa\P
2635     Xaaaa\P
2636    
2637     /X\D{2,4}+b/
2638     X\P
2639     Xa\P
2640     Xaa\P
2641     Xaaa\P
2642     Xaaaa\P
2643    
2644     /X[abc]{2,4}b/
2645     X\P
2646     Xa\P
2647     Xaa\P
2648     Xaaa\P
2649     Xaaaa\P
2650    
2651     /X[abc]{2,4}?b/
2652     X\P
2653     Xa\P
2654     Xaa\P
2655     Xaaa\P
2656     Xaaaa\P
2657    
2658     /X[abc]{2,4}+b/
2659     X\P
2660     Xa\P
2661     Xaa\P
2662     Xaaa\P
2663     Xaaaa\P
2664    
2665     /X[^a]{2,4}b/
2666     X\P
2667     Xz\P
2668     Xzz\P
2669     Xzzz\P
2670     Xzzzz\P
2671    
2672     /X[^a]{2,4}?b/
2673     X\P
2674     Xz\P
2675     Xzz\P
2676     Xzzz\P
2677     Xzzzz\P
2678    
2679     /X[^a]{2,4}+b/
2680     X\P
2681     Xz\P
2682     Xzz\P
2683     Xzzz\P
2684     Xzzzz\P
2685    
2686     /(Y)X\1{2,4}b/
2687     YX\P
2688     YXY\P
2689     YXYY\P
2690     YXYYY\P
2691     YXYYYY\P
2692    
2693     /(Y)X\1{2,4}?b/
2694     YX\P
2695     YXY\P
2696     YXYY\P
2697     YXYYY\P
2698     YXYYYY\P
2699    
2700     /(Y)X\1{2,4}+b/
2701     YX\P
2702     YXY\P
2703     YXYY\P
2704     YXYYY\P
2705     YXYYYY\P
2706    
2707     /\++\KZ|\d+X|9+Y/
2708     ++++123999\P
2709     ++++123999Y\P
2710     ++++Z1234\P
2711    
2712     /Z(*F)/
2713     Z\P
2714     ZA\P
2715    
2716     /Z(?!)/
2717     Z\P
2718     ZA\P
2719    
2720 ph10 427 /dog(sbody)?/
2721     dogs\P
2722     dogs\P\P
2723    
2724 ph10 428 /dog(sbody)??/
2725     dogs\P
2726     dogs\P\P
2727    
2728 ph10 427 /dog|dogsbody/
2729     dogs\P
2730     dogs\P\P
2731    
2732 ph10 428 /dogsbody|dog/
2733     dogs\P
2734     dogs\P\P
2735    
2736     /\bthe cat\b/
2737     the cat\P
2738     the cat\P\P
2739    
2740     /abc/
2741     abc\P
2742     abc\P\P
2743 ph10 432
2744     /\w+A/P
2745     CDAAAAB
2746 ph10 428
2747 ph10 432 /\w+A/PU
2748     CDAAAAB
2749    
2750 ph10 435 /abc\K123/
2751     xyzabc123pqr
2752     xyzabc12\P
2753     xyzabc12\P\P
2754    
2755     /(?<=abc)123/
2756     xyzabc123pqr
2757     xyzabc12\P
2758     xyzabc12\P\P
2759    
2760     /\babc\b/
2761     +++abc+++
2762     +++ab\P
2763     +++ab\P\P
2764    
2765 ph10 438 /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
2766    
2767     /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
2768    
2769 ph10 449 /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
2770    
2771 ph10 442 /abc\K/+
2772     abcdef
2773     abcdef\N\N
2774     xyzabcdef\N\N
2775     ** Failers
2776     abcdef\N
2777     xyzabcdef\N
2778    
2779     /^(?:(?=abc)|abc\K)/+
2780     abcdef
2781     abcdef\N\N
2782     ** Failers
2783     abcdef\N
2784    
2785     /a?b?/+
2786     xyz
2787     xyzabc
2788     xyzabc\N
2789     xyzabc\N\N
2790     xyz\N\N
2791     ** Failers
2792     xyz\N
2793    
2794     /^a?b?/+
2795     xyz
2796     xyzabc
2797     ** Failers
2798     xyzabc\N
2799     xyzabc\N\N
2800     xyz\N\N
2801     xyz\N
2802    
2803 ph10 448 /^(?<name>a|b\g<name>c)/
2804     aaaa
2805     bacxxx
2806     bbaccxxx
2807     bbbacccxx
2808    
2809     /^(?<name>a|b\g'name'c)/
2810     aaaa
2811     bacxxx
2812     bbaccxxx
2813     bbbacccxx
2814    
2815     /^(a|b\g<1>c)/
2816     aaaa
2817     bacxxx
2818     bbaccxxx
2819     bbbacccxx
2820    
2821     /^(a|b\g'1'c)/
2822     aaaa
2823     bacxxx
2824     bbaccxxx
2825     bbbacccxx
2826    
2827     /^(a|b\g'-1'c)/
2828     aaaa
2829     bacxxx
2830     bbaccxxx
2831     bbbacccxx
2832    
2833     /(^(a|b\g<-1>c))/
2834     aaaa
2835     bacxxx
2836     bbaccxxx
2837     bbbacccxx
2838    
2839     /(?-i:\g<name>)(?i:(?<name>a))/
2840     XaaX
2841     XAAX
2842    
2843     /(?i:\g<name>)(?-i:(?<name>a))/
2844     XaaX
2845     ** Failers
2846     XAAX
2847    
2848     /(?-i:\g<+1>)(?i:(a))/
2849     XaaX
2850     XAAX
2851    
2852     /(?=(?<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>\})\}))\{/
2853    
2854     /(?<n>a|b|c)\g<n>*/
2855     abc
2856     accccbbb
2857    
2858     /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2859     XYabcdY
2860    
2861 ph10 454 /(?<=b(?1)|zzz)(a)/
2862     xbaax
2863     xzzzax
2864    
2865     /(a)(?<=b\1)/
2866    
2867     /(a)(?<=b+(?1))/
2868    
2869     /(a+)(?<=b(?1))/
2870    
2871     /(a(?<=b(?1)))/
2872    
2873     /(?<=b(?1))xyz/
2874    
2875     /(?<=b(?1))xyz(b+)pqrstuvew/
2876    
2877 ph10 455 /(a|bc)\1/SI
2878    
2879     /(a|bc)\1{2,3}/SI
2880    
2881     /(a|bc)(?1)/SI
2882    
2883     /(a|b\1)(a|b\1)/SI
2884    
2885     /(a|b\1){2}/SI
2886    
2887     /(a|bbbb\1)(a|bbbb\1)/SI
2888    
2889     /(a|bbbb\1){2}/SI
2890    
2891     /^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
2892    
2893     / (?: [\040\t] | \(
2894     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2895     \) )* # optional leading comment
2896     (?: (?:
2897     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2898     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2899     |
2900     " (?: # opening quote...
2901     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2902     | # or
2903     \\ [^\x80-\xff] # Escaped something (something != CR)
2904     )* " # closing quote
2905     ) # initial word
2906     (?: (?: [\040\t] | \(
2907     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2908     \) )* \. (?: [\040\t] | \(
2909     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2910     \) )* (?:
2911     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2912     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2913     |
2914     " (?: # opening quote...
2915     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2916     | # or
2917     \\ [^\x80-\xff] # Escaped something (something != CR)
2918     )* " # closing quote
2919     ) )* # further okay, if led by a period
2920     (?: [\040\t] | \(
2921     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2922     \) )* @ (?: [\040\t] | \(
2923     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2924     \) )* (?:
2925     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2926     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2927     | \[ # [
2928     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2929     \] # ]
2930     ) # initial subdomain
2931     (?: #
2932     (?: [\040\t] | \(
2933     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2934     \) )* \. # if led by a period...
2935     (?: [\040\t] | \(
2936     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2937     \) )* (?:
2938     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2939     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2940     | \[ # [
2941     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2942     \] # ]
2943     ) # ...further okay
2944     )*
2945     # address
2946     | # or
2947     (?:
2948     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2949     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2950     |
2951     " (?: # opening quote...
2952     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2953     | # or
2954     \\ [^\x80-\xff] # Escaped something (something != CR)
2955     )* " # closing quote
2956     ) # one word, optionally followed by....
2957     (?:
2958     [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
2959     \(
2960     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2961     \) | # comments, or...
2962    
2963     " (?: # opening quote...
2964     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2965     | # or
2966     \\ [^\x80-\xff] # Escaped something (something != CR)
2967     )* " # closing quote
2968     # quoted strings
2969     )*
2970     < (?: [\040\t] | \(
2971     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2972     \) )* # leading <
2973     (?: @ (?: [\040\t] | \(
2974     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2975     \) )* (?:
2976     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2977     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2978     | \[ # [
2979     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2980     \] # ]
2981     ) # initial subdomain
2982     (?: #
2983     (?: [\040\t] | \(
2984     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2985     \) )* \. # if led by a period...
2986     (?: [\040\t] | \(
2987     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2988     \) )* (?:
2989     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2990     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2991     | \[ # [
2992     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2993     \] # ]
2994     ) # ...further okay
2995     )*
2996    
2997     (?: (?: [\040\t] | \(
2998     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2999     \) )* , (?: [\040\t] | \(
3000     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3001     \) )* @ (?: [\040\t] | \(
3002     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3003     \) )* (?:
3004     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3005     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3006     | \[ # [
3007     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3008     \] # ]
3009     ) # initial subdomain
3010     (?: #
3011     (?: [\040\t] | \(
3012     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3013     \) )* \. # if led by a period...
3014     (?: [\040\t] | \(
3015     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3016     \) )* (?:
3017     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3018     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3019     | \[ # [
3020     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3021     \] # ]
3022     ) # ...further okay
3023     )*
3024     )* # further okay, if led by comma
3025     : # closing colon
3026     (?: [\040\t] | \(
3027     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3028     \) )* )? # optional route
3029     (?:
3030     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3031     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3032     |
3033     " (?: # opening quote...
3034     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
3035     | # or
3036     \\ [^\x80-\xff] # Escaped something (something != CR)
3037     )* " # closing quote
3038     ) # initial word
3039     (?: (?: [\040\t] | \(
3040     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3041     \) )* \. (?: [\040\t] | \(
3042     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3043     \) )* (?:
3044     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3045     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3046     |
3047     " (?: # opening quote...
3048     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
3049     | # or
3050     \\ [^\x80-\xff] # Escaped something (something != CR)
3051     )* " # closing quote
3052     ) )* # further okay, if led by a period
3053     (?: [\040\t] | \(
3054     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3055     \) )* @ (?: [\040\t] | \(
3056     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3057     \) )* (?:
3058     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3059     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3060     | \[ # [
3061     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3062     \] # ]
3063     ) # initial subdomain
3064     (?: #
3065     (?: [\040\t] | \(
3066     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3067     \) )* \. # if led by a period...
3068     (?: [\040\t] | \(
3069     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3070     \) )* (?:
3071     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3072     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3073     | \[ # [
3074     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3075     \] # ]
3076     ) # ...further okay
3077     )*
3078     # address spec
3079     (?: [\040\t] | \(
3080     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3081     \) )* > # trailing >
3082     # name and address
3083     ) (?: [\040\t] | \(
3084     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3085     \) )* # optional trailing comment
3086     /xSI
3087    
3088     /<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
3089    
3090     "(?>.*/)foo"SI
3091    
3092     /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
3093    
3094     /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
3095    
3096     /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
3097    
3098     /<a[\s]+href[\s]*=[\s]* # find <a href=
3099     ([\"\'])? # find single or double quote
3100     (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
3101     # quote, otherwise match up to next space
3102     /isxSI
3103    
3104     /^(?!:) # colon disallowed at start
3105     (?: # start of item
3106     (?: [0-9a-f]{1,4} | # 1-4 hex digits or
3107     (?(1)0 | () ) ) # if null previously matched, fail; else null
3108     : # followed by colon
3109     ){1,7} # end item; 1-7 of them required
3110     [0-9a-f]{1,4} $ # final hex number at end of string
3111     (?(1)|.) # check that there was an empty component
3112     /xiIS
3113    
3114 ph10 457 /(?|(?<a>A)|(?<a>B))/I
3115     AB\Ca
3116     BA\Ca
3117    
3118     /(?|(?<a>A)|(?<b>B))/
3119    
3120 ph10 459 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
3121     b(?<quote> (?<apostrophe>')|(?<realquote>")) )
3122     (?('quote')[a-z]+|[0-9]+)/JIx
3123     a"aaaaa
3124     b"aaaaa
3125     ** Failers
3126     b"11111
3127     a"11111
3128    
3129 ph10 461 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
3130 ph10 459 abcdX
3131     eX
3132     ** Failers
3133     abcdY
3134     ey
3135    
3136 ph10 461 /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/JDZx
3137 ph10 459 abcdd
3138     ** Failers
3139     abcdde
3140    
3141 ph10 462 /abcd*/
3142     xxxxabcd\P
3143     xxxxabcd\P\P
3144    
3145     /abcd*/i
3146     xxxxabcd\P
3147     xxxxabcd\P\P
3148     XXXXABCD\P
3149     XXXXABCD\P\P
3150    
3151     /abc\d*/
3152     xxxxabc1\P
3153     xxxxabc1\P\P
3154    
3155     /(a)bc\1*/
3156     xxxxabca\P
3157     xxxxabca\P\P
3158    
3159     /abc[de]*/
3160     xxxxabcde\P
3161     xxxxabcde\P\P
3162    
3163 ph10 464 /-- This is not in the Perl 5.10 test because Perl seems currently to be broken
3164     and not behaving as specified in that it *does* bumpalong after hitting
3165     (*COMMIT). --/
3166    
3167     /(?1)(A(*COMMIT)|B)D/
3168     ABD
3169     XABD
3170     BAD
3171     ABXABD
3172     ** Failers
3173     ABX
3174     BAXBAD
3175    
3176 ph10 467 /(\3)(\1)(a)/<JS>
3177     cat
3178    
3179     /(\3)(\1)(a)/SI<JS>
3180     cat
3181    
3182     /(\3)(\1)(a)/SI
3183     cat
3184    
3185 ph10 471 /i(?(DEFINE)(?<s>a))/SI
3186     i
3187    
3188     /()i(?(1)a)/SI
3189     ia
3190    
3191 ph10 472 /(?i)a(?-i)b|c/BZ
3192     XabX
3193     XAbX
3194     CcC
3195     ** Failers
3196     XABX
3197    
3198     /(?i)a(?s)b|c/BZ
3199    
3200     /(?i)a(?s-i)b|c/BZ
3201    
3202 ph10 488 /^(ab(c\1)d|x){2}$/BZ
3203     xabcxd
3204 ph10 496
3205     /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
3206 ph10 488
3207 ph10 496 /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
3208    
3209 ph10 500 / -- The first four of these are not in the Perl 5.10 test because Perl
3210     documents that the use of \K in assertions is "not well defined". The
3211     last is here because Perl gives the match as "b" rather than "ab". I
3212     believe this to be a Perl bug. --/
3213    
3214     /(?=a\Kb)ab/
3215     ab
3216    
3217     /(?!a\Kb)ac/
3218     ac
3219    
3220     /^abc(?<=b\Kc)d/
3221     abcd
3222    
3223     /^abc(?<!b\Kq)d/
3224     abcd
3225    
3226     /(?>a\Kb)z|(ab)/
3227     ab
3228    
3229     /----------------------/
3230    
3231 ph10 504 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3232    
3233 ph10 510 /abc(*MARK:)pqr/
3234    
3235     /abc(*:)pqr/
3236    
3237     /abc(*FAIL:123)xyz/
3238    
3239     /--- This should, and does, fail. In Perl, it does not, which I think is a
3240     bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3241    
3242     /A(*COMMIT)B/+K
3243     ACABX
3244    
3245     /--- These should be different, but in Perl 5.11 are not, which I think
3246     is a bug in Perl. ---/
3247    
3248     /A(*THEN)B|A(*THEN)C/K
3249     AC
3250    
3251     /A(*PRUNE)B|A(*PRUNE)C/K
3252     AC
3253    
3254     /--- A whole lot of tests of verbs with arguments are here rather than in test
3255     11 because Perl doesn't seem to follow its specification entirely
3256     correctly. ---/
3257    
3258     /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
3259     not clear how Perl defines "involved in the failure of the match". ---/
3260    
3261     /^(A(*THEN:A)B|C(*THEN:B)D)/K
3262     AB
3263     CD
3264     ** Failers
3265     AC
3266     CB
3267    
3268     /--- Check the use of names for success and failure. PCRE doesn't show these
3269     names for success, though Perl does, contrary to its spec. ---/
3270    
3271     /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
3272     AB
3273     CD
3274     ** Failers
3275     AC
3276     CB
3277    
3278     /--- An empty name does not pass back an empty string. It is the same as if no
3279     name were given. ---/
3280    
3281     /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
3282     AB
3283     CD
3284    
3285     /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
3286    
3287     /A(*PRUNE:A)B/K
3288     ACAB
3289    
3290     /(*MARK:A)(*PRUNE:B)(C|X)/K
3291     C
3292     D
3293    
3294     /(*MARK:A)(*THEN:B)(C|X)/K
3295     C
3296     D
3297    
3298     /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
3299    
3300     /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
3301     AAAC
3302    
3303     /--- Same --/
3304    
3305     /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
3306     AAAC
3307    
3308     /--- This should fail; the SKIP advances by one, but when we get to AC, the
3309     PRUNE kills it. ---/
3310    
3311     /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3312     AAAC
3313    
3314     /A(*:A)A+(*SKIP)(B|Z) | AC/xK
3315     AAAC
3316    
3317     /--- This should fail, as a null name is the same as no name ---/
3318    
3319     /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
3320     AAAC
3321    
3322     /--- This fails in PCRE, and I think that is in accordance with Perl's
3323     documentation, though in Perl it succeeds. ---/
3324    
3325     /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
3326     AAAC
3327    
3328     /--- Mark names can be duplicated ---/
3329    
3330     /A(*:A)B|X(*:A)Y/K
3331     AABC
3332     XXYZ
3333    
3334     /^A(*:A)B|^X(*:A)Y/K
3335     ** Failers
3336     XAQQ
3337    
3338     /--- A check on what happens after hitting a mark and them bumping along to
3339     something that does not even start. Perl reports tags after the failures here,
3340     though it does not when the individual letters are made into something
3341     more complicated. ---/
3342    
3343     /A(*:A)B|XX(*:B)Y/K
3344     AABC
3345     XXYZ
3346     ** Failers
3347     XAQQ
3348     XAQQXZZ
3349     AXQQQ
3350     AXXQQQ
3351    
3352     /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3353     optimizations defeat this. So does the PCRE optimization unless we disable it
3354     with \Y. ---/
3355    
3356     /(*COMMIT)ABC/
3357     ABCDEFG
3358     ** Failers
3359     DEFGABC\Y
3360    
3361     /--- Repeat some tests with added studying. ---/
3362    
3363     /A(*COMMIT)B/+KS
3364     ACABX
3365    
3366     /A(*THEN)B|A(*THEN)C/KS
3367     AC
3368    
3369     /A(*PRUNE)B|A(*PRUNE)C/KS
3370     AC
3371    
3372     /^(A(*THEN:A)B|C(*THEN:B)D)/KS
3373     AB
3374     CD
3375     ** Failers
3376     AC
3377     CB
3378    
3379     /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
3380     AB
3381     CD
3382     ** Failers
3383     AC
3384     CB
3385    
3386     /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
3387     AB
3388     CD
3389    
3390     /A(*PRUNE:A)B/KS
3391     ACAB
3392    
3393     /(*MARK:A)(*PRUNE:B)(C|X)/KS
3394     C
3395     D
3396    
3397     /(*MARK:A)(*THEN:B)(C|X)/KS
3398     C
3399     D
3400    
3401     /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
3402     AAAC
3403    
3404     /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
3405     AAAC
3406    
3407     /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
3408     AAAC
3409    
3410     /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
3411     AAAC
3412    
3413     /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
3414     AAAC
3415    
3416     /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
3417     AAAC
3418    
3419     /A(*:A)B|XX(*:B)Y/KS
3420     AABC
3421     XXYZ
3422     ** Failers
3423     XAQQ
3424     XAQQXZZ
3425     AXQQQ
3426     AXXQQQ
3427    
3428     /(*COMMIT)ABC/
3429     ABCDEFG
3430     ** Failers
3431     DEFGABC\Y
3432    
3433     /^(ab (c+(*THEN)cd) | xyz)/x
3434     abcccd
3435    
3436     /^(ab (c+(*PRUNE)cd) | xyz)/x
3437     abcccd
3438    
3439     /^(ab (c+(*FAIL)cd) | xyz)/x
3440     abcccd
3441 ph10 511
3442     /--- Perl 5.11 gets some of these wrong ---/
3443 ph10 510
3444 ph10 511 /(?>.(*ACCEPT))*?5/
3445     abcde
3446    
3447     /(.(*ACCEPT))*?5/
3448     abcde
3449    
3450     /(.(*ACCEPT))5/
3451     abcde
3452    
3453     /(.(*ACCEPT))*5/
3454     abcde
3455    
3456 ph10 450 /-- End of testinput2 --/

Properties

Name Value
svn:keywords "Author Date Id Revision Url"

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12