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

Contents of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 647 - (hide annotations) (download)
Mon Aug 1 10:22:59 2011 UTC (3 years, 2 months ago) by ph10
File size: 69903 byte(s)
Add tests for *MARK in callouts, and update pcretest documentation.

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