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

Contents of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 602 - (hide annotations) (download)
Wed May 25 08:29:03 2011 UTC (2 years, 10 months ago) by ph10
File size: 67279 byte(s)
Remove OP_OPT by handling /i and /m entirely at compile time. Fixes bug with 
patterns like /(?i:([^b]))(?1)/, where the /i option was mishandled.

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|$))(\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$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\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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_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     /(?C1)\dabc(?C2)def/I
1065 nigel 63 1234abcdef
1066     *** Failers
1067 ph10 102 abcdef
1068    
1069 nigel 93 /(?C255)ab/I
1070 nigel 63
1071 nigel 93 /(?C256)ab/I
1072 nigel 63
1073 ph10 102 /(?Cab)xx/I
1074 nigel 63
1075 nigel 93 /(?C12vr)x/I
1076 nigel 63
1077 nigel 93 /abc(?C)def/I
1078 nigel 63 *** Failers
1079     \x83\x0\x61bcdef
1080    
1081 nigel 93 /(abc)(?C)de(?C1)f/I
1082 nigel 63 123abcdef
1083 ph10 102 123abcdef\C+
1084     123abcdef\C-
1085 nigel 63 *** Failers
1086 ph10 102 123abcdef\C!1
1087    
1088 nigel 93 /(?C0)(abc(?C1))*/I
1089 nigel 63 abcabcabc
1090 ph10 102 abcabc\C!1!3
1091 nigel 63 *** Failers
1092 ph10 102 abcabcabc\C!1!3
1093 nigel 63
1094 nigel 93 /(\d{3}(?C))*/I
1095 nigel 63 123\C+
1096     123456\C+
1097 ph10 102 123456789\C+
1098 nigel 63
1099 nigel 93 /((xyz)(?C)p|(?C1)xyzabc)/I
1100 nigel 63 xyzabc\C+
1101    
1102 nigel 93 /(X)((xyz)(?C)p|(?C1)xyzabc)/I
1103 nigel 63 Xxyzabc\C+
1104    
1105 nigel 93 /(?=(abc))(?C)abcdef/I
1106 nigel 63 abcdef\C+
1107 ph10 102
1108 nigel 93 /(?!(abc)(?C1)d)(?C2)abcxyz/I
1109 ph10 102 abcxyz\C+
1110 nigel 63
1111 nigel 93 /(?<=(abc)(?C))xyz/I
1112 nigel 63 abcxyz\C+
1113 ph10 102
1114 nigel 93 /a(b+)(c*)(?C1)/I
1115 nigel 77 abbbbbccc\C*1
1116    
1117 nigel 93 /a(b+?)(c*?)(?C1)/I
1118 nigel 77 abbbbbccc\C*1
1119 nigel 63
1120 ph10 102 /(?C)abc/I
1121    
1122 nigel 93 /(?C)^abc/I
1123 nigel 63
1124 nigel 93 /(?C)a|b/IS
1125 nigel 63
1126 nigel 93 /(?R)/I
1127 nigel 63
1128 nigel 93 /(a|(?R))/I
1129 nigel 63
1130 nigel 93 /(ab|(bc|(de|(?R))))/I
1131 nigel 63
1132 nigel 93 /x(ab|(bc|(de|(?R))))/I
1133 nigel 63 xab
1134     xbc
1135     xde
1136     xxab
1137     xxxab
1138     *** Failers
1139 ph10 102 xyab
1140 nigel 63
1141 nigel 93 /(ab|(bc|(de|(?1))))/I
1142 nigel 63
1143 nigel 93 /x(ab|(bc|(de|(?1)x)x)x)/I
1144 nigel 63
1145 nigel 93 /^([^()]|\((?1)*\))*$/I
1146 nigel 63 abc
1147     a(b)c
1148 ph10 102 a(b(c))d
1149 nigel 63 *** Failers)
1150 ph10 102 a(b(c)d
1151 nigel 63
1152 nigel 93 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
1153 nigel 63 >abc>123<xyz<
1154     >abc>1(2)3<xyz<
1155     >abc>(1(2)3)<xyz<
1156    
1157 ph10 161 /(a(?1)b)/DZ
1158 nigel 63
1159 ph10 161 /(a(?1)+b)/DZ
1160 nigel 63
1161 nigel 93 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
1162 nigel 63 12
1163     (((2+2)*-3)-7)
1164     -12
1165     *** Failers
1166     ((2+2)*-3)-7)
1167 ph10 102
1168 nigel 93 /^(x(y|(?1){2})z)/I
1169 nigel 63 xyz
1170 ph10 102 xxyzxyzz
1171 nigel 63 *** Failers
1172     xxyzz
1173 ph10 102 xxyzxyzxyzz
1174 nigel 63
1175 nigel 93 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
1176 nigel 63 <>
1177     <abcd>
1178     <abc <123> hij>
1179     <abc <def> hij>
1180 ph10 102 <abc<>def>
1181     <abc<>
1182 nigel 63 *** Failers
1183     <abc
1184    
1185 nigel 93 /(?1)/I
1186 nigel 63
1187 nigel 93 /((?2)(abc)/I
1188 nigel 63
1189 nigel 93 /^(abc)def(?1)/I
1190 nigel 63 abcdefabc
1191    
1192 nigel 93 /^(a|b|c)=(?1)+/I
1193 nigel 63 a=a
1194     a=b
1195 ph10 102 a=bc
1196 nigel 63
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 ph10 161 /a(?P<name1>b|c)d(?P<longername2>e)/DZ
1203 nigel 63 abde
1204 ph10 102 acde
1205 nigel 63
1206 ph10 161 /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/DZ
1207 nigel 63
1208 ph10 161 /(?P<a>a)...(?P=a)bbb(?P>a)d/DZ
1209 nigel 63
1210 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
1211 nigel 63 1221
1212     Satan, oscillate my metallic sonatas!
1213     A man, a plan, a canal: Panama!
1214 ph10 102 Able was I ere I saw Elba.
1215 nigel 63 *** Failers
1216 ph10 102 The quick brown fox
1217    
1218 nigel 93 /((?(R)a|b))\1(?1)?/I
1219 nigel 63 bb
1220 ph10 102 bbaa
1221 nigel 63
1222 nigel 93 /(.*)a/Is
1223 nigel 63
1224 nigel 93 /(.*)a\1/Is
1225 nigel 63
1226 nigel 93 /(.*)a(b)\2/Is
1227 nigel 63
1228 nigel 93 /((.*)a|(.*)b)z/Is
1229 nigel 63
1230 nigel 93 /((.*)a|(.*)b)z\1/Is
1231 nigel 63
1232 nigel 93 /((.*)a|(.*)b)z\2/Is
1233 nigel 63
1234 nigel 93 /((.*)a|(.*)b)z\3/Is
1235 nigel 63
1236 nigel 93 /((.*)a|^(.*)b)z\3/Is
1237 nigel 63
1238 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
1239 nigel 63
1240 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
1241 nigel 63
1242 nigel 93 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
1243 nigel 63
1244 ph10 161 /(a)(bc)/INDZ
1245 nigel 63 abc
1246    
1247 ph10 161 /(?P<one>a)(bc)/INDZ
1248 nigel 63 abc
1249    
1250 ph10 161 /(a)(?P<named>bc)/INDZ
1251 nigel 63
1252 nigel 93 /(a+)*zz/I
1253 nigel 63 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
1254     aaaaaaaaaaaaaz\M
1255    
1256 nigel 93 /(aaa(?C1)bbb|ab)/I
1257 nigel 63 aaabbb
1258     aaabbb\C*0
1259     aaabbb\C*1
1260     aaabbb\C*-1
1261    
1262 nigel 93 /ab(?P<one>cd)ef(?P<two>gh)/I
1263 nigel 63 abcdefgh
1264     abcdefgh\C1\Gtwo
1265     abcdefgh\Cone\Ctwo
1266 ph10 102 abcdefgh\Cthree
1267 nigel 63
1268 ph10 161 /(?P<Tes>)(?P<Test>)/DZ
1269 nigel 63
1270 ph10 161 /(?P<Test>)(?P<Tes>)/DZ
1271 nigel 63
1272 nigel 93 /(?P<Z>zz)(?P<A>aa)/I
1273 nigel 63 zzaa\CZ
1274     zzaa\CA
1275    
1276 nigel 93 /(?P<x>eks)(?P<x>eccs)/I
1277 nigel 65
1278 nigel 93 /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
1279 nigel 65
1280 nigel 93 "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
1281 nigel 73 [10,20,30,5,5,4,4,2,43,23,4234]
1282     *** Failers
1283 ph10 102 []
1284 nigel 73
1285 nigel 93 "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
1286 nigel 73 [10,20,30,5,5,4,4,2,43,23,4234]
1287 ph10 102 []
1288 nigel 73
1289 ph10 161 /(a(b(?2)c))?/DZ
1290 nigel 73
1291 ph10 161 /(a(b(?2)c))*/DZ
1292 nigel 73
1293 ph10 161 /(a(b(?2)c)){0,2}/DZ
1294 nigel 73
1295 ph10 161 /[ab]{1}+/DZ
1296 nigel 73
1297 nigel 93 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
1298 nigel 73 Baby Bjorn Active Carrier - With free SHIPPING!!
1299    
1300 nigel 93 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS
1301 nigel 73 Baby Bjorn Active Carrier - With free SHIPPING!!
1302 ph10 102
1303 ph10 161 /a*.*b/ISDZ
1304 nigel 73
1305 ph10 161 /(a|b)*.?c/ISDZ
1306 nigel 73
1307 ph10 161 /abc(?C255)de(?C)f/DZ
1308 nigel 75
1309 ph10 161 /abcde/ICDZ
1310 nigel 75 abcde
1311 ph10 102 abcdfe
1312    
1313 ph10 161 /a*b/ICDZ
1314 nigel 75 ab
1315     aaaab
1316 ph10 102 aaaacb
1317 nigel 75
1318 ph10 161 /a+b/ICDZ
1319 nigel 75 ab
1320     aaaab
1321 ph10 102 aaaacb
1322 nigel 75
1323 ph10 161 /(abc|def)x/ICDZ
1324 nigel 75 abcx
1325     defx
1326     abcdefzx
1327    
1328 nigel 93 /(ab|cd){3,4}/IC
1329 nigel 75 ababab
1330     abcdabcd
1331 ph10 102 abcdcdcdcdcd
1332 nigel 75
1333 ph10 161 /([ab]{,4}c|xy)/ICDZ
1334 nigel 75 Note: that { does NOT introduce a quantifier
1335    
1336 ph10 161 /([ab]{1,4}c|xy){4,5}?123/ICDZ
1337 nigel 75 aacaacaacaacaac123
1338    
1339     /\b.*/I
1340     ab cd\>1
1341 ph10 102
1342     /\b.*/Is
1343 nigel 75 ab cd\>1
1344 ph10 102
1345 nigel 75 /(?!.bcd).*/I
1346 ph10 102 Xbcd12345
1347 nigel 75
1348 nigel 93 /abcde/I
1349 nigel 75 ab\P
1350     abc\P
1351     abcd\P
1352 ph10 102 abcde\P
1353 nigel 75 the quick brown abc\P
1354     ** Failers\P
1355     the quick brown abxyz fox\P
1356 ph10 102
1357 nigel 93 "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
1358 nigel 75 13/05/04\P
1359     13/5/2004\P
1360 ph10 102 02/05/09\P
1361 nigel 75 1\P
1362     1/2\P
1363     1/2/0\P
1364 ph10 102 1/2/04\P
1365 nigel 75 0\P
1366     02/\P
1367 ph10 102 02/0\P
1368 nigel 75 02/1\P
1369     ** Failers\P
1370     \P
1371     123\P
1372     33/4/04\P
1373     3/13/04\P
1374     0/1/2003\P
1375 ph10 102 0/\P
1376     02/0/\P
1377     02/13\P
1378 nigel 75
1379     /0{0,2}ABC/I
1380 ph10 102
1381 nigel 75 /\d{3,}ABC/I
1382 ph10 102
1383 nigel 75 /\d*ABC/I
1384    
1385     /[abc]+DE/I
1386    
1387 nigel 93 /[abc]?123/I
1388 nigel 75 123\P
1389     a\P
1390     b\P
1391     c\P
1392     c12\P
1393 ph10 102 c123\P
1394 nigel 75
1395 nigel 93 /^(?:\d){3,5}X/I
1396 nigel 75 1\P
1397     123\P
1398     123X
1399     1234\P
1400     1234X
1401     12345\P
1402 ph10 102 12345X
1403     *** Failers
1404     1X
1405     123456\P
1406 nigel 75
1407 nigel 93 /abc/I>testsavedregex
1408 nigel 75 <testsavedregex
1409     abc
1410     ** Failers
1411     bca
1412 ph10 102
1413 nigel 93 /abc/IF>testsavedregex
1414 nigel 75 <testsavedregex
1415     abc
1416     ** Failers
1417     bca
1418    
1419 nigel 93 /(a|b)/IS>testsavedregex
1420 nigel 75 <testsavedregex
1421     abc
1422     ** Failers
1423 ph10 102 def
1424    
1425 nigel 93 /(a|b)/ISF>testsavedregex
1426 nigel 75 <testsavedregex
1427     abc
1428     ** Failers
1429 ph10 102 def
1430    
1431 nigel 93 ~<(\w+)/?>(.)*</(\1)>~smgI
1432 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>
1433    
1434     /^a/IF
1435    
1436 nigel 93 /line\nbreak/I
1437 nigel 77 this is a line\nbreak
1438 ph10 102 line one\nthis is a line\nbreak in the second line
1439 nigel 77
1440 nigel 93 /line\nbreak/If
1441 nigel 77 this is a line\nbreak
1442 ph10 102 ** Failers
1443     line one\nthis is a line\nbreak in the second line
1444 nigel 77
1445 nigel 93 /line\nbreak/Imf
1446 nigel 77 this is a line\nbreak
1447 ph10 102 ** Failers
1448     line one\nthis is a line\nbreak in the second line
1449 nigel 77
1450 ph10 432 /ab.cd/P
1451 nigel 77 ab-cd
1452 ph10 102 ab=cd
1453 nigel 77 ** Failers
1454     ab\ncd
1455    
1456 ph10 432 /ab.cd/Ps
1457 nigel 77 ab-cd
1458 ph10 102 ab=cd
1459 nigel 77 ab\ncd
1460    
1461 nigel 93 /(?i)(?-i)AbCd/I
1462 nigel 79 AbCd
1463     ** Failers
1464 ph10 102 abcd
1465    
1466 nigel 93 /a{11111111111111111111}/I
1467 nigel 79
1468 nigel 93 /(){64294967295}/I
1469 nigel 81
1470 nigel 93 /(){2,4294967295}/I
1471 nigel 81
1472 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
1473 nigel 81 abcdefghijklAkB
1474    
1475 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
1476 nigel 81 abcdefghijklAkB
1477    
1478 nigel 93 "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
1479 nigel 81 abcdefghijklAkB
1480    
1481 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
1482 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1483    
1484 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
1485 nigel 81 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1486    
1487 nigel 93 /[^()]*(?:\((?R)\)[^()]*)*/I
1488 nigel 87 (this(and)that
1489 ph10 102 (this(and)that)
1490 nigel 87 (this(and)that)stuff
1491    
1492 nigel 93 /[^()]*(?:\((?>(?R))\)[^()]*)*/I
1493 nigel 87 (this(and)that
1494 ph10 102 (this(and)that)
1495    
1496 nigel 93 /[^()]*(?:\((?R)\))*[^()]*/I
1497 nigel 87 (this(and)that
1498 ph10 102 (this(and)that)
1499 nigel 87
1500 nigel 93 /(?:\((?R)\))*[^()]*/I
1501 nigel 87 (this(and)that
1502 ph10 102 (this(and)that)
1503     ((this))
1504 nigel 87
1505 nigel 93 /(?:\((?R)\))|[^()]*/I
1506 nigel 87 (this(and)that
1507 ph10 102 (this(and)that)
1508 nigel 87 (this)
1509 ph10 102 ((this))
1510    
1511 ph10 432 /a(b)c/PN
1512 nigel 87 abc
1513 ph10 102
1514 ph10 432 /a(?P<name>b)c/PN
1515 ph10 102 abc
1516 nigel 87
1517 ph10 102 /\x{100}/I
1518    
1519 nigel 93 /\x{0000ff}/I
1520 nigel 87
1521 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/I
1522 nigel 91
1523 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1524 nigel 91 a1b\CA
1525 ph10 102 a2b\CA
1526 nigel 91 ** Failers
1527 ph10 102 a1b\CZ\CA
1528    
1529 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1530 nigel 91 ab\CA
1531 ph10 102
1532 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1533 nigel 91 ab\CA
1534 ph10 102 cd\CA
1535    
1536 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1537 ph10 102 cdefgh\CA
1538    
1539 nigel 93 /^((?P<A>a1)|(?P<A>a2)b)/IJ
1540 nigel 91 a1b\GA
1541 ph10 102 a2b\GA
1542 nigel 91 ** Failers
1543 ph10 102 a1b\GZ\GA
1544    
1545 nigel 93 /^(?P<A>a)(?P<A>b)/IJ
1546 nigel 91 ab\GA
1547 ph10 102
1548 nigel 93 /^(?P<A>a)(?P<A>b)|cd/IJ
1549 nigel 91 ab\GA
1550 ph10 102 cd\GA
1551    
1552 nigel 93 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
1553 ph10 102 cdefgh\GA
1554    
1555 nigel 93 /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
1556 nigel 91 a1b\CA
1557 ph10 102 a2b\CA
1558    
1559 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
1560 nigel 91
1561     / In this next test, J is not set at the outer level; consequently it isn't
1562 ph10 102 set in the pattern's options; consequently pcre_get_named_substring() produces
1563 nigel 93 a random value. /Ix
1564 nigel 91
1565 nigel 93 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
1566 nigel 91 a bc d\CA\CB\CC
1567    
1568 nigel 93 /^(?P<A>a)?(?(A)a|b)/I
1569 nigel 91 aabc
1570     bc
1571     ** Failers
1572 ph10 102 abc
1573 nigel 91
1574 nigel 93 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
1575 nigel 91 bXaX
1576    
1577 nigel 93 /(?:(?(2y)a|b)(X))+/I
1578 nigel 91
1579 nigel 93 /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
1580 nigel 91
1581 nigel 93 /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
1582 nigel 91 bbXaaX
1583    
1584 nigel 93 /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
1585 nigel 91 (b)\\Xa\\X
1586    
1587 nigel 93 /(?P<ABC/I
1588 nigel 91
1589 nigel 93 /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1590 nigel 91 bXXaYYaY
1591 ph10 102 bXYaXXaX
1592 nigel 91
1593 nigel 93 /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1594 nigel 91 bXXaYYaY
1595    
1596 nigel 93 /\777/I
1597 nigel 91
1598 nigel 93 /\s*,\s*/IS
1599 nigel 91 \x0b,\x0b
1600 ph10 102 \x0c,\x0d
1601 nigel 91
1602 nigel 93 /^abc/Im
1603 nigel 91 xyz\nabc
1604     xyz\nabc\<lf>
1605     xyz\r\nabc\<lf>
1606     xyz\rabc\<cr>
1607     xyz\r\nabc\<crlf>
1608 ph10 102 ** Failers
1609 nigel 91 xyz\nabc\<cr>
1610     xyz\r\nabc\<cr>
1611     xyz\nabc\<crlf>
1612     xyz\rabc\<crlf>
1613     xyz\rabc\<lf>
1614 ph10 102
1615 nigel 93 /abc$/Im<lf>
1616 nigel 91 xyzabc
1617 ph10 102 xyzabc\n
1618     xyzabc\npqr
1619     xyzabc\r\<cr>
1620     xyzabc\rpqr\<cr>
1621     xyzabc\r\n\<crlf>
1622     xyzabc\r\npqr\<crlf>
1623 nigel 91 ** Failers
1624 ph10 102 xyzabc\r
1625     xyzabc\rpqr
1626     xyzabc\r\n
1627     xyzabc\r\npqr
1628    
1629 nigel 93 /^abc/Im<cr>
1630 nigel 91 xyz\rabcdef
1631     xyz\nabcdef\<lf>
1632 ph10 102 ** Failers
1633 nigel 91 xyz\nabcdef
1634 ph10 102
1635 nigel 93 /^abc/Im<lf>
1636 nigel 91 xyz\nabcdef
1637     xyz\rabcdef\<cr>
1638 ph10 102 ** Failers
1639 nigel 91 xyz\rabcdef
1640 ph10 102
1641 nigel 93 /^abc/Im<crlf>
1642 nigel 91 xyz\r\nabcdef
1643     xyz\rabcdef\<cr>
1644 ph10 102 ** Failers
1645 nigel 91 xyz\rabcdef
1646 ph10 102
1647 nigel 93 /^abc/Im<bad>
1648 nigel 91
1649 nigel 93 /abc/I
1650 nigel 91 xyz\rabc\<bad>
1651 ph10 102 abc
1652    
1653 nigel 93 /.*/I<lf>
1654 nigel 91 abc\ndef
1655     abc\rdef
1656     abc\r\ndef
1657     \<cr>abc\ndef
1658     \<cr>abc\rdef
1659     \<cr>abc\r\ndef
1660     \<crlf>abc\ndef
1661     \<crlf>abc\rdef
1662     \<crlf>abc\r\ndef
1663    
1664 nigel 93 /\w+(.)(.)?def/Is
1665 nigel 91 abc\ndef
1666     abc\rdef
1667     abc\r\ndef
1668    
1669 nigel 93 +((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I
1670 nigel 91 /* this is a C style comment */\M
1671    
1672 nigel 93 /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
1673 nigel 91
1674 nigel 93 /()()()()()()()()()()()()()()()()()()()()
1675     ()()()()()()()()()()()()()()()()()()()()
1676     ()()()()()()()()()()()()()()()()()()()()
1677     ()()()()()()()()()()()()()()()()()()()()
1678     ()()()()()()()()()()()()()()()()()()()()
1679     (.(.))/Ix
1680 ph10 102 XY\O400
1681 nigel 93
1682     /(a*b|(?i:c*(?-i)d))/IS
1683    
1684     /()[ab]xyz/IS
1685    
1686     /(|)[ab]xyz/IS
1687    
1688     /(|c)[ab]xyz/IS
1689    
1690     /(|c?)[ab]xyz/IS
1691    
1692     /(d?|c?)[ab]xyz/IS
1693    
1694     /(d?|c)[ab]xyz/IS
1695    
1696 ph10 161 /^a*b\d/DZ
1697 nigel 93
1698 ph10 161 /^a*+b\d/DZ
1699 nigel 93
1700 ph10 161 /^a*?b\d/DZ
1701 nigel 93
1702 ph10 161 /^a+A\d/DZ
1703 nigel 93 aaaA5
1704     ** Failers
1705 ph10 102 aaaa5
1706 nigel 93
1707 ph10 161 /^a*A\d/IiDZ
1708 nigel 93 aaaA5
1709     aaaa5
1710    
1711     /(a*|b*)[cd]/IS
1712    
1713     /(a+|b*)[cd]/IS
1714    
1715     /(a*|b+)[cd]/IS
1716    
1717     /(a+|b+)[cd]/IS
1718    
1719     /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1720     ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1721     (((
1722     a
1723     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1724     ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1725 ph10 102 )))
1726     /Ix
1727 nigel 93 large nest
1728    
1729 ph10 162 /a*\d/BZ
1730 nigel 93
1731 ph10 162 /a*\D/BZ
1732 nigel 93
1733 ph10 162 /0*\d/BZ
1734 nigel 93
1735 ph10 162 /0*\D/BZ
1736 nigel 93
1737 ph10 162 /a*\s/BZ
1738 nigel 93
1739 ph10 162 /a*\S/BZ
1740 nigel 93
1741 ph10 162 / *\s/BZ
1742 nigel 93
1743 ph10 162 / *\S/BZ
1744 nigel 93
1745 ph10 162 /a*\w/BZ
1746 nigel 93
1747 ph10 162 /a*\W/BZ
1748 nigel 93
1749 ph10 162 /=*\w/BZ
1750 nigel 93
1751 ph10 162 /=*\W/BZ
1752 nigel 93
1753 ph10 162 /\d*a/BZ
1754 nigel 93
1755 ph10 162 /\d*2/BZ
1756 nigel 93
1757 ph10 162 /\d*\d/BZ
1758 nigel 93
1759 ph10 162 /\d*\D/BZ
1760 nigel 93
1761 ph10 162 /\d*\s/BZ
1762 nigel 93
1763 ph10 162 /\d*\S/BZ
1764 nigel 93
1765 ph10 162 /\d*\w/BZ
1766 nigel 93
1767 ph10 162 /\d*\W/BZ
1768 nigel 93
1769 ph10 162 /\D*a/BZ
1770 nigel 93
1771 ph10 162 /\D*2/BZ
1772 nigel 93
1773 ph10 162 /\D*\d/BZ
1774 nigel 93
1775 ph10 162 /\D*\D/BZ
1776 nigel 93
1777 ph10 162 /\D*\s/BZ
1778 nigel 93
1779 ph10 162 /\D*\S/BZ
1780 nigel 93
1781 ph10 162 /\D*\w/BZ
1782 nigel 93
1783 ph10 162 /\D*\W/BZ
1784 nigel 93
1785 ph10 162 /\s*a/BZ
1786 nigel 93
1787 ph10 162 /\s*2/BZ
1788 nigel 93
1789 ph10 162 /\s*\d/BZ
1790 nigel 93
1791 ph10 162 /\s*\D/BZ
1792 nigel 93
1793 ph10 162 /\s*\s/BZ
1794 nigel 93
1795 ph10 162 /\s*\S/BZ
1796 nigel 93
1797 ph10 162 /\s*\w/BZ
1798 nigel 93
1799 ph10 162 /\s*\W/BZ
1800 nigel 93
1801 ph10 162 /\S*a/BZ
1802 nigel 93
1803 ph10 162 /\S*2/BZ
1804 nigel 93
1805 ph10 162 /\S*\d/BZ
1806 nigel 93
1807 ph10 162 /\S*\D/BZ
1808 nigel 93
1809 ph10 162 /\S*\s/BZ
1810 nigel 93
1811 ph10 162 /\S*\S/BZ
1812 nigel 93
1813 ph10 162 /\S*\w/BZ
1814 nigel 93
1815 ph10 162 /\S*\W/BZ
1816 nigel 93
1817 ph10 162 /\w*a/BZ
1818 nigel 93
1819 ph10 162 /\w*2/BZ
1820 nigel 93
1821 ph10 162 /\w*\d/BZ
1822 nigel 93
1823 ph10 162 /\w*\D/BZ
1824 nigel 93
1825 ph10 162 /\w*\s/BZ
1826 nigel 93
1827 ph10 162 /\w*\S/BZ
1828 nigel 93
1829 ph10 162 /\w*\w/BZ
1830 nigel 93
1831 ph10 162 /\w*\W/BZ
1832 nigel 93
1833 ph10 162 /\W*a/BZ
1834 nigel 93
1835 ph10 162 /\W*2/BZ
1836 nigel 93
1837 ph10 162 /\W*\d/BZ
1838 nigel 93
1839 ph10 162 /\W*\D/BZ
1840 nigel 93
1841 ph10 162 /\W*\s/BZ
1842 nigel 93
1843 ph10 162 /\W*\S/BZ
1844 nigel 93
1845 ph10 162 /\W*\w/BZ
1846 nigel 93
1847 ph10 162 /\W*\W/BZ
1848 nigel 93
1849 ph10 162 /[^a]+a/BZ
1850 nigel 93
1851 ph10 162 /[^a]+a/BZi
1852 nigel 93
1853 ph10 162 /[^a]+A/BZi
1854 nigel 93
1855 ph10 162 /[^a]+b/BZ
1856 nigel 93
1857 ph10 162 /[^a]+\d/BZ
1858 nigel 93
1859 ph10 162 /a*[^a]/BZ
1860 nigel 93
1861     /(?P<abc>x)(?P<xyz>y)/I
1862     xy\Cabc\Cxyz
1863    
1864     /(?<abc>x)(?'xyz'y)/I
1865     xy\Cabc\Cxyz
1866    
1867     /(?<abc'x)(?'xyz'y)/I
1868    
1869     /(?<abc>x)(?'xyz>y)/I
1870    
1871     /(?P'abc'x)(?P<xyz>y)/I
1872    
1873     /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
1874     bXaX
1875     bXbX
1876     ** Failers
1877 ph10 102 aXaX
1878     aXbX
1879 nigel 93
1880     /^(?P>abc)(?<abcd>xxx)/
1881    
1882     /^(?P>abc)(?<abc>x|y)/
1883     xx
1884     xy
1885     yy
1886 ph10 102 yx
1887 nigel 93
1888     /^(?P>abc)(?P<abc>x|y)/
1889     xx
1890     xy
1891     yy
1892 ph10 102 yx
1893 nigel 93
1894     /^((?(abc)a|b)(?<abc>x|y))+/
1895     bxay
1896 ph10 102 bxby
1897 nigel 93 ** Failers
1898 ph10 102 axby
1899 nigel 93
1900     /^(((?P=abc)|X)(?<abc>x|y))+/
1901     XxXxxx
1902     XxXyyx
1903     XxXyxx
1904     ** Failers
1905 ph10 102 x
1906 nigel 93
1907     /^(?1)(abc)/
1908     abcabc
1909    
1910     /^(?:(?:\1|X)(a|b))+/
1911     Xaaa
1912 ph10 102 Xaba
1913 nigel 93
1914 ph10 162 /^[\E\Qa\E-\Qz\E]+/BZ
1915 ph10 102
1916 ph10 162 /^[a\Q]bc\E]/BZ
1917 ph10 102
1918 ph10 162 /^[a-\Q\E]/BZ
1919 nigel 93
1920 ph10 162 /^(?P>abc)[()](?<abc>)/BZ
1921 nigel 93
1922 ph10 162 /^((?(abc)y)[()](?P<abc>x))+/BZ
1923 nigel 93 (xy)x
1924    
1925 ph10 162 /^(?P>abc)\Q()\E(?<abc>)/BZ
1926 nigel 93
1927 ph10 162 /^(?P>abc)[a\Q(]\E(](?<abc>)/BZ
1928 ph10 102
1929 nigel 93 /^(?P>abc) # this is (a comment)
1930 ph10 162 (?<abc>)/BZx
1931 nigel 93
1932     /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
1933     1221
1934     Satan, oscillate my metallic sonatas!
1935     A man, a plan, a canal: Panama!
1936 ph10 102 Able was I ere I saw Elba.
1937 nigel 93 *** Failers
1938 ph10 102 The quick brown fox
1939    
1940 nigel 93 /(?=(\w+))\1:/I
1941     abcd:
1942    
1943     /(?=(?'abc'\w+))\k<abc>:/I
1944     abcd:
1945    
1946     /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
1947     adaa
1948     ** Failers
1949     addd
1950 ph10 102 adbb
1951 nigel 93
1952     /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/J
1953     bdaa
1954     bdab
1955     ** Failers
1956 ph10 102 bddd
1957 nigel 93
1958     /(?(<bc))/
1959    
1960 ph10 102 /(?(''))/
1961 nigel 93
1962     /(?('R')stuff)/
1963    
1964     /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
1965     abcabc1Xabc2XabcXabcabc
1966    
1967     /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1968     abcabc1Xabc2XabcXabcabc
1969    
1970     /(?<A> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1971    
1972     /(?<1> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1973     abcabc1Xabc2XabcXabcabc
1974    
1975     /^(?(DEFINE) abc | xyz ) /x
1976 ph10 102
1977 nigel 93 /(?(DEFINE) abc) xyz/xI
1978    
1979     /(?(DEFINE) abc){3} xyz/x
1980    
1981     /(a|)*\d/
1982     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1983     \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
1984    
1985     /^a.b/<lf>
1986     a\rb
1987 ph10 102 a\nb\<cr>
1988 ph10 149 a\x85b\<anycrlf>
1989 nigel 93 ** Failers
1990     a\nb
1991     a\nb\<any>
1992 ph10 102 a\rb\<cr>
1993     a\rb\<any>
1994 ph10 149 a\x85b\<any>
1995     a\rb\<anycrlf>
1996 nigel 93
1997     /^abc./mgx<any>
1998 ph10 355 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
1999 nigel 93
2000     /abc.$/mgx<any>
2001 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
2002 nigel 93
2003     /a/<cr><any>
2004    
2005     /a/<any><crlf>
2006    
2007 ph10 247 /^a\Rb/<bsr_unicode>
2008 nigel 93 a\nb
2009     a\rb
2010     a\r\nb
2011     a\x0bb
2012     a\x0cb
2013 ph10 102 a\x85b
2014 nigel 93 ** Failers
2015 ph10 102 a\n\rb
2016 nigel 93
2017 ph10 247 /^a\R*b/<bsr_unicode>
2018 nigel 93 ab
2019     a\nb
2020     a\rb
2021     a\r\nb
2022     a\x0bb
2023     a\x0cb
2024 ph10 102 a\x85b
2025     a\n\rb
2026     a\n\r\x85\x0cb
2027 nigel 93
2028 ph10 247 /^a\R+b/<bsr_unicode>
2029 nigel 93 a\nb
2030     a\rb
2031     a\r\nb
2032     a\x0bb
2033     a\x0cb
2034 ph10 102 a\x85b
2035     a\n\rb
2036     a\n\r\x85\x0cb
2037 nigel 93 ** Failers
2038 ph10 102 ab
2039    
2040 ph10 247 /^a\R{1,3}b/<bsr_unicode>
2041 nigel 93 a\nb
2042     a\n\rb
2043     a\n\r\x85b
2044 ph10 102 a\r\n\r\nb
2045     a\r\n\r\n\r\nb
2046 nigel 93 a\n\r\n\rb
2047 ph10 102 a\n\n\r\nb
2048 nigel 93 ** Failers
2049     a\n\n\n\rb
2050     a\r
2051    
2052 ph10 247 /^a[\R]b/<bsr_unicode>
2053 nigel 93 aRb
2054     ** Failers
2055 ph10 102 a\nb
2056 nigel 93
2057     /(?&abc)X(?<abc>P)/I
2058     abcPXP123
2059    
2060     /(?1)X(?<abc>P)/I
2061     abcPXP123
2062    
2063     /(?:a(?&abc)b)*(?<abc>x)/
2064     123axbaxbaxbx456
2065     123axbaxbaxb456
2066 ph10 102
2067 nigel 93 /(?:a(?&abc)b){1,5}(?<abc>x)/
2068     123axbaxbaxbx456
2069    
2070     /(?:a(?&abc)b){2,5}(?<abc>x)/
2071     123axbaxbaxbx456
2072    
2073     /(?:a(?&abc)b){2,}(?<abc>x)/
2074     123axbaxbaxbx456
2075    
2076     /(abc)(?i:(?1))/
2077     defabcabcxyz
2078     DEFabcABCXYZ
2079    
2080     /(abc)(?:(?i)(?1))/
2081     defabcabcxyz
2082     DEFabcABCXYZ
2083    
2084     /^(a)\g-2/
2085    
2086     /^(a)\g/
2087    
2088     /^(a)\g{0}/
2089    
2090     /^(a)\g{3/
2091    
2092     /^(a)\g{4a}/
2093    
2094     /^a.b/<lf>
2095     a\rb
2096     *** Failers
2097     a\nb
2098    
2099     /.+foo/
2100     afoo
2101 ph10 102 ** Failers
2102     \r\nfoo
2103     \nfoo
2104 nigel 93
2105     /.+foo/<crlf>
2106     afoo
2107 ph10 102 \nfoo
2108     ** Failers
2109     \r\nfoo
2110 nigel 93
2111     /.+foo/<any>
2112     afoo
2113 ph10 102 ** Failers
2114     \nfoo
2115     \r\nfoo
2116 nigel 93
2117     /.+foo/s
2118     afoo
2119 ph10 102 \r\nfoo
2120     \nfoo
2121 ph10 131
2122     /^$/mg<any>
2123     abc\r\rxyz
2124     abc\n\rxyz
2125     ** Failers
2126     abc\r\nxyz
2127 nigel 93
2128 ph10 141 /(?m)^$/<any>g+
2129     abc\r\n\r\n
2130    
2131 ph10 143 /(?m)^$|^\r\n/<any>g+
2132     abc\r\n\r\n
2133    
2134     /(?m)$/<any>g+
2135     abc\r\n\r\n
2136    
2137 ph10 149 /abc.$/mgx<anycrlf>
2138 ph10 355 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
2139 ph10 149
2140 ph10 155 /^X/m
2141     XABC
2142     ** Failers
2143     XABC\B
2144    
2145 ph10 174 /(ab|c)(?-1)/BZ
2146 ph10 166 abc
2147    
2148 ph10 174 /xy(?+1)(abc)/BZ
2149 ph10 166 xyabcabc
2150     ** Failers
2151     xyabc
2152    
2153     /x(?-0)y/
2154    
2155     /x(?-1)y/
2156    
2157     /x(?+0)y/
2158    
2159     /x(?+1)y/
2160    
2161 ph10 174 /^(abc)?(?(-1)X|Y)/BZ
2162 ph10 167 abcX
2163     Y
2164     ** Failers
2165     abcY
2166    
2167 ph10 174 /^((?(+1)X|Y)(abc))+/BZ
2168 ph10 167 YabcXabc
2169     YabcXabcXabc
2170     ** Failers
2171     XabcXabc
2172    
2173 ph10 174 /(?(-1)a)/BZ
2174 ph10 167
2175 ph10 174 /((?(-1)a))/BZ
2176 ph10 167
2177 ph10 174 /((?(-2)a))/BZ
2178 ph10 167
2179 ph10 270 /^(?(+1)X|Y)(.)/BZ
2180     Y!
2181 ph10 167
2182 ph10 171 /(?<A>tom|bon)-\k{A}/
2183     tom-tom
2184     bon-bon
2185     ** Failers
2186     tom-bon
2187    
2188     /\g{A/
2189    
2190 ph10 175 /(?|(abc)|(xyz))/BZ
2191     >abc<
2192     >xyz<
2193    
2194     /(x)(?|(abc)|(xyz))(x)/BZ
2195     xabcx
2196     xxyzx
2197    
2198     /(x)(?|(abc)(pqr)|(xyz))(x)/BZ
2199     xabcpqrx
2200     xxyzx
2201    
2202 ph10 178 /[\h]/BZ
2203     >\x09<
2204    
2205     /[\h]+/BZ
2206     >\x09\x20\xa0<
2207    
2208     /[\v]/BZ
2209    
2210     /[\H]/BZ
2211    
2212     /[^\h]/BZ
2213    
2214     /[\V]/BZ
2215    
2216     /[\x0a\V]/BZ
2217    
2218 ph10 180 /\H++X/BZ
2219     ** Failers
2220     XXXX
2221    
2222     /\H+\hY/BZ
2223     XXXX Y
2224    
2225     /\H+ Y/BZ
2226    
2227     /\h+A/BZ
2228    
2229     /\v*B/BZ
2230    
2231     /\V+\x0a/BZ
2232    
2233     /A+\h/BZ
2234    
2235     / *\H/BZ
2236    
2237     /A*\v/BZ
2238    
2239     /\x0b*\V/BZ
2240    
2241     /\d+\h/BZ
2242    
2243     /\d*\v/BZ
2244    
2245     /S+\h\S+\v/BZ
2246    
2247     /\w{3,}\h\w+\v/BZ
2248    
2249     /\h+\d\h+\w\h+\S\h+\H/BZ
2250    
2251     /\v+\d\v+\w\v+\S\v+\V/BZ
2252    
2253     /\H+\h\H+\d/BZ
2254    
2255     /\V+\v\V+\w/BZ
2256    
2257 ph10 197 /\( (?: [^()]* | (?R) )* \)/x
2258     (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(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C
2275     aaaaaa
2276    
2277     /a+b?c+(*FAIL)/C
2278     aaabccc
2279    
2280     /a+b?(*PRUNE)c+(*FAIL)/C
2281     aaabccc
2282    
2283     /a+b?(*COMMIT)c+(*FAIL)/C
2284     aaabccc
2285    
2286     /a+b?(*SKIP)c+(*FAIL)/C
2287     aaabcccaaabccc
2288    
2289     /a+b?(*THEN)c+(*FAIL)/C
2290     aaabccc
2291    
2292     /a(*MARK)b/
2293    
2294 ph10 213 /(?i:A{1,}\6666666666)/
2295    
2296     /\g6666666666/
2297    
2298     /[\g6666666666]/
2299    
2300 ph10 215 /(?1)\c[/
2301    
2302 ph10 226 /.+A/<crlf>
2303     \r\nA
2304    
2305     /\nA/<crlf>
2306     \r\nA
2307    
2308     /[\r\n]A/<crlf>
2309     \r\nA
2310    
2311     /(\r|\n)A/<crlf>
2312     \r\nA
2313    
2314 ph10 227 /a(*CR)b/
2315    
2316     /(*CR)a.b/
2317     a\nb
2318     ** Failers
2319     a\rb
2320    
2321     /(*CR)a.b/<lf>
2322     a\nb
2323     ** Failers
2324     a\rb
2325    
2326     /(*LF)a.b/<CRLF>
2327     a\rb
2328     ** Failers
2329     a\nb
2330    
2331     /(*CRLF)a.b/
2332     a\rb
2333     a\nb
2334     ** Failers
2335     a\r\nb
2336    
2337     /(*ANYCRLF)a.b/<CR>
2338     ** Failers
2339     a\rb
2340     a\nb
2341     a\r\nb
2342    
2343     /(*ANY)a.b/<cr>
2344     ** Failers
2345     a\rb
2346     a\nb
2347     a\r\nb
2348     a\x85b
2349 ph10 566
2350     /(*ANY).*/g
2351     abc\r\ndef
2352 ph10 227
2353 ph10 566 /(*ANYCRLF).*/g
2354     abc\r\ndef
2355    
2356     /(*CRLF).*/g
2357     abc\r\ndef
2358    
2359 ph10 231 /a\Rb/I<bsr_anycrlf>
2360     a\rb
2361     a\nb
2362     a\r\nb
2363     ** Failers
2364     a\x85b
2365     a\x0bb
2366    
2367     /a\Rb/I<bsr_unicode>
2368     a\rb
2369     a\nb
2370     a\r\nb
2371     a\x85b
2372     a\x0bb
2373     ** Failers
2374     a\x85b\<bsr_anycrlf>
2375     a\x0bb\<bsr_anycrlf>
2376    
2377     /a\R?b/I<bsr_anycrlf>
2378     a\rb
2379     a\nb
2380     a\r\nb
2381     ** Failers
2382     a\x85b
2383     a\x0bb
2384    
2385     /a\R?b/I<bsr_unicode>
2386     a\rb
2387     a\nb
2388     a\r\nb
2389     a\x85b
2390     a\x0bb
2391     ** Failers
2392     a\x85b\<bsr_anycrlf>
2393     a\x0bb\<bsr_anycrlf>
2394    
2395     /a\R{2,4}b/I<bsr_anycrlf>
2396     a\r\n\nb
2397     a\n\r\rb
2398     a\r\n\r\n\r\n\r\nb
2399     ** Failers
2400     a\x85\85b
2401     a\x0b\0bb
2402    
2403     /a\R{2,4}b/I<bsr_unicode>
2404     a\r\rb
2405     a\n\n\nb
2406     a\r\n\n\r\rb
2407     a\x85\85b
2408     a\x0b\0bb
2409     ** Failers
2410     a\r\r\r\r\rb
2411     a\x85\85b\<bsr_anycrlf>
2412     a\x0b\0bb\<bsr_anycrlf>
2413    
2414     /(*BSR_ANYCRLF)a\Rb/I
2415     a\nb
2416     a\rb
2417    
2418     /(*BSR_UNICODE)a\Rb/I
2419     a\x85b
2420    
2421     /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
2422     a\nb
2423     a\rb
2424    
2425     /(*CRLF)(*BSR_UNICODE)a\Rb/I
2426     a\x85b
2427    
2428     /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
2429    
2430 ph10 268 /(?<a>)(?&)/
2431    
2432     /(?<abc>)(?&a)/
2433    
2434     /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
2435    
2436 ph10 269 /(?+-a)/
2437    
2438     /(?-+a)/
2439    
2440 ph10 271 /(?(-1))/
2441    
2442     /(?(+10))/
2443    
2444     /(?(10))/
2445    
2446     /(?(+2))()()/
2447    
2448     /(?(2))()()/
2449    
2450 ph10 272 /\k''/
2451    
2452     /\k<>/
2453    
2454     /\k{}/
2455    
2456     /(?P=)/
2457    
2458     /(?P>)/
2459    
2460 ph10 282 /(?!\w)(?R)/
2461    
2462     /(?=\w)(?R)/
2463    
2464     /(?<!\w)(?R)/
2465    
2466     /(?<=\w)(?R)/
2467    
2468 ph10 295 /[[:foo:]]/
2469    
2470     /[[:1234:]]/
2471    
2472     /[[:f\oo:]]/
2473    
2474     /[[: :]]/
2475    
2476     /[[:...:]]/
2477    
2478     /[[:l\ower:]]/
2479    
2480     /[[:abc\:]]/
2481    
2482     /[abc[:x\]pqr:]]/
2483    
2484     /[[:a\dz:]]/
2485    
2486 ph10 333 /(^(a|b\g<-1'c))/
2487    
2488 ph10 335 /^(?+1)(?<a>x|y){0}z/
2489     xzxx
2490     yzyy
2491     ** Failers
2492     xxz
2493    
2494 ph10 336 /(\3)(\1)(a)/
2495     cat
2496    
2497     /(\3)(\1)(a)/<JS>
2498     cat
2499    
2500     /TA]/
2501     The ACTA] comes
2502    
2503     /TA]/<JS>
2504     The ACTA] comes
2505    
2506 ph10 340 /(?2)[]a()b](abc)/
2507     abcbabc
2508    
2509     /(?2)[^]a()b](abc)/
2510     abcbabc
2511    
2512     /(?1)[]a()b](abc)/
2513     abcbabc
2514     ** Failers
2515     abcXabc
2516    
2517     /(?1)[^]a()b](abc)/
2518     abcXabc
2519     ** Failers
2520     abcbabc
2521    
2522     /(?2)[]a()b](abc)(xyz)/
2523     xyzbabcxyz
2524    
2525     /(?&N)[]a(?<N>)](?<M>abc)/
2526     abc<abc
2527    
2528     /(?&N)[]a(?<N>)](abc)/
2529     abc<abc
2530    
2531 ph10 341 /a[]b/
2532    
2533     /a[^]b/
2534    
2535     /a[]b/<JS>
2536     ** Failers
2537     ab
2538    
2539     /a[]+b/<JS>
2540     ** Failers
2541     ab
2542    
2543     /a[]*+b/<JS>
2544     ** Failers
2545     ab
2546    
2547     /a[^]b/<JS>
2548     aXb
2549     a\nb
2550     ** Failers
2551     ab
2552    
2553     /a[^]+b/<JS>
2554     aXb
2555     a\nX\nXb
2556     ** Failers
2557     ab
2558    
2559     /a(?!)+b/
2560    
2561     /a(*FAIL)+b/
2562    
2563 ph10 353 /(abc|pqr|123){0}[xyz]/SI
2564    
2565 ph10 381 /(?(?=.*b)b|^)/CI
2566     adc
2567     abc
2568    
2569     /(?(?=b).*b|^d)/I
2570    
2571     /(?(?=.*b).*b|^d)/I
2572    
2573 ph10 388 /a?|b?/P
2574     abc
2575     ** Failers
2576     ddd\N
2577    
2578 ph10 389 /xyz/C
2579     xyz
2580     abcxyz
2581     abcxyz\Y
2582     ** Failers
2583     abc
2584     abc\Y
2585     abcxypqr
2586     abcxypqr\Y
2587 ph10 576
2588     /(*NO_START_OPT)xyz/C
2589     abcxyz
2590 ph10 389
2591 ph10 576 /xyz/CY
2592     abcxyz
2593    
2594 ph10 399 /^"((?(?=[a])[^"])|b)*"$/C
2595     "ab"
2596    
2597     /^"((?(?=[a])[^"])|b)*"$/
2598     "ab"
2599    
2600 ph10 408 /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
2601     XYabcdY
2602    
2603     /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
2604     XYabcdY
2605    
2606 ph10 426 /Xa{2,4}b/
2607     X\P
2608     Xa\P
2609     Xaa\P
2610     Xaaa\P
2611     Xaaaa\P
2612    
2613     /Xa{2,4}?b/
2614     X\P
2615     Xa\P
2616     Xaa\P
2617     Xaaa\P
2618     Xaaaa\P
2619    
2620     /Xa{2,4}+b/
2621     X\P
2622     Xa\P
2623     Xaa\P
2624     Xaaa\P
2625     Xaaaa\P
2626    
2627     /X\d{2,4}b/
2628     X\P
2629     X3\P
2630     X33\P
2631     X333\P
2632     X3333\P
2633    
2634     /X\d{2,4}?b/
2635     X\P
2636     X3\P
2637     X33\P
2638     X333\P
2639     X3333\P
2640    
2641     /X\d{2,4}+b/
2642     X\P
2643     X3\P
2644     X33\P
2645     X333\P
2646     X3333\P
2647    
2648     /X\D{2,4}b/
2649     X\P
2650     Xa\P
2651     Xaa\P
2652     Xaaa\P
2653     Xaaaa\P
2654    
2655     /X\D{2,4}?b/
2656     X\P
2657     Xa\P
2658     Xaa\P
2659     Xaaa\P
2660     Xaaaa\P
2661    
2662     /X\D{2,4}+b/
2663     X\P
2664     Xa\P
2665     Xaa\P
2666     Xaaa\P
2667     Xaaaa\P
2668    
2669     /X[abc]{2,4}b/
2670     X\P
2671     Xa\P
2672     Xaa\P
2673     Xaaa\P
2674     Xaaaa\P
2675    
2676     /X[abc]{2,4}?b/
2677     X\P
2678     Xa\P
2679     Xaa\P
2680     Xaaa\P
2681     Xaaaa\P
2682    
2683     /X[abc]{2,4}+b/
2684     X\P
2685     Xa\P
2686     Xaa\P
2687     Xaaa\P
2688     Xaaaa\P
2689    
2690     /X[^a]{2,4}b/
2691     X\P
2692     Xz\P
2693     Xzz\P
2694     Xzzz\P
2695     Xzzzz\P
2696    
2697     /X[^a]{2,4}?b/
2698     X\P
2699     Xz\P
2700     Xzz\P
2701     Xzzz\P
2702     Xzzzz\P
2703    
2704     /X[^a]{2,4}+b/
2705     X\P
2706     Xz\P
2707     Xzz\P
2708     Xzzz\P
2709     Xzzzz\P
2710    
2711     /(Y)X\1{2,4}b/
2712     YX\P
2713     YXY\P
2714     YXYY\P
2715     YXYYY\P
2716     YXYYYY\P
2717    
2718     /(Y)X\1{2,4}?b/
2719     YX\P
2720     YXY\P
2721     YXYY\P
2722     YXYYY\P
2723     YXYYYY\P
2724    
2725     /(Y)X\1{2,4}+b/
2726     YX\P
2727     YXY\P
2728     YXYY\P
2729     YXYYY\P
2730     YXYYYY\P
2731    
2732     /\++\KZ|\d+X|9+Y/
2733     ++++123999\P
2734     ++++123999Y\P
2735     ++++Z1234\P
2736    
2737     /Z(*F)/
2738     Z\P
2739     ZA\P
2740    
2741     /Z(?!)/
2742     Z\P
2743     ZA\P
2744    
2745 ph10 427 /dog(sbody)?/
2746     dogs\P
2747     dogs\P\P
2748    
2749 ph10 428 /dog(sbody)??/
2750     dogs\P
2751     dogs\P\P
2752    
2753 ph10 427 /dog|dogsbody/
2754     dogs\P
2755     dogs\P\P
2756    
2757 ph10 428 /dogsbody|dog/
2758     dogs\P
2759     dogs\P\P
2760    
2761     /\bthe cat\b/
2762     the cat\P
2763     the cat\P\P
2764    
2765     /abc/
2766     abc\P
2767     abc\P\P
2768 ph10 432
2769     /\w+A/P
2770     CDAAAAB
2771 ph10 428
2772 ph10 432 /\w+A/PU
2773     CDAAAAB
2774    
2775 ph10 435 /abc\K123/
2776     xyzabc123pqr
2777     xyzabc12\P
2778     xyzabc12\P\P
2779    
2780     /(?<=abc)123/
2781     xyzabc123pqr
2782     xyzabc12\P
2783     xyzabc12\P\P
2784    
2785     /\babc\b/
2786     +++abc+++
2787     +++ab\P
2788     +++ab\P\P
2789    
2790 ph10 438 /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
2791    
2792     /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
2793    
2794 ph10 449 /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
2795    
2796 ph10 442 /abc\K/+
2797     abcdef
2798     abcdef\N\N
2799     xyzabcdef\N\N
2800     ** Failers
2801     abcdef\N
2802     xyzabcdef\N
2803    
2804     /^(?:(?=abc)|abc\K)/+
2805     abcdef
2806     abcdef\N\N
2807     ** Failers
2808     abcdef\N
2809    
2810     /a?b?/+
2811     xyz
2812     xyzabc
2813     xyzabc\N
2814     xyzabc\N\N
2815     xyz\N\N
2816     ** Failers
2817     xyz\N
2818    
2819     /^a?b?/+
2820     xyz
2821     xyzabc
2822     ** Failers
2823     xyzabc\N
2824     xyzabc\N\N
2825     xyz\N\N
2826     xyz\N
2827    
2828 ph10 448 /^(?<name>a|b\g<name>c)/
2829     aaaa
2830     bacxxx
2831     bbaccxxx
2832     bbbacccxx
2833    
2834     /^(?<name>a|b\g'name'c)/
2835     aaaa
2836     bacxxx
2837     bbaccxxx
2838     bbbacccxx
2839    
2840     /^(a|b\g<1>c)/
2841     aaaa
2842     bacxxx
2843     bbaccxxx
2844     bbbacccxx
2845    
2846     /^(a|b\g'1'c)/
2847     aaaa
2848     bacxxx
2849     bbaccxxx
2850     bbbacccxx
2851    
2852     /^(a|b\g'-1'c)/
2853     aaaa
2854     bacxxx
2855     bbaccxxx
2856     bbbacccxx
2857    
2858     /(^(a|b\g<-1>c))/
2859     aaaa
2860     bacxxx
2861     bbaccxxx
2862     bbbacccxx
2863    
2864     /(?-i:\g<name>)(?i:(?<name>a))/
2865     XaaX
2866     XAAX
2867    
2868     /(?i:\g<name>)(?-i:(?<name>a))/
2869     XaaX
2870     ** Failers
2871     XAAX
2872    
2873     /(?-i:\g<+1>)(?i:(a))/
2874     XaaX
2875     XAAX
2876    
2877     /(?=(?<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>\})\}))\{/
2878    
2879     /(?<n>a|b|c)\g<n>*/
2880     abc
2881     accccbbb
2882    
2883     /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2884     XYabcdY
2885    
2886 ph10 454 /(?<=b(?1)|zzz)(a)/
2887     xbaax
2888     xzzzax
2889    
2890     /(a)(?<=b\1)/
2891    
2892     /(a)(?<=b+(?1))/
2893    
2894     /(a+)(?<=b(?1))/
2895    
2896     /(a(?<=b(?1)))/
2897    
2898     /(?<=b(?1))xyz/
2899    
2900     /(?<=b(?1))xyz(b+)pqrstuvew/
2901    
2902 ph10 455 /(a|bc)\1/SI
2903    
2904     /(a|bc)\1{2,3}/SI
2905    
2906     /(a|bc)(?1)/SI
2907    
2908     /(a|b\1)(a|b\1)/SI
2909    
2910     /(a|b\1){2}/SI
2911    
2912     /(a|bbbb\1)(a|bbbb\1)/SI
2913    
2914     /(a|bbbb\1){2}/SI
2915    
2916     /^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
2917    
2918     / (?: [\040\t] | \(
2919     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2920     \) )* # optional leading comment
2921     (?: (?:
2922     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2923     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2924     |
2925     " (?: # opening quote...
2926     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2927     | # or
2928     \\ [^\x80-\xff] # Escaped something (something != CR)
2929     )* " # closing quote
2930     ) # initial word
2931     (?: (?: [\040\t] | \(
2932     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2933     \) )* \. (?: [\040\t] | \(
2934     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2935     \) )* (?:
2936     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2937     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2938     |
2939     " (?: # opening quote...
2940     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2941     | # or
2942     \\ [^\x80-\xff] # Escaped something (something != CR)
2943     )* " # closing quote
2944     ) )* # further okay, if led by a period
2945     (?: [\040\t] | \(
2946     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2947     \) )* @ (?: [\040\t] | \(
2948     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2949     \) )* (?:
2950     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2951     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2952     | \[ # [
2953     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2954     \] # ]
2955     ) # initial subdomain
2956     (?: #
2957     (?: [\040\t] | \(
2958     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2959     \) )* \. # if led by a period...
2960     (?: [\040\t] | \(
2961     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2962     \) )* (?:
2963     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2964     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2965     | \[ # [
2966     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2967     \] # ]
2968     ) # ...further okay
2969     )*
2970     # address
2971     | # or
2972     (?:
2973     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2974     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2975     |
2976     " (?: # opening quote...
2977     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2978     | # or
2979     \\ [^\x80-\xff] # Escaped something (something != CR)
2980     )* " # closing quote
2981     ) # one word, optionally followed by....
2982     (?:
2983     [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
2984     \(
2985     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2986     \) | # comments, or...
2987    
2988     " (?: # opening quote...
2989     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2990     | # or
2991     \\ [^\x80-\xff] # Escaped something (something != CR)
2992     )* " # closing quote
2993     # quoted strings
2994     )*
2995     < (?: [\040\t] | \(
2996     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2997     \) )* # leading <
2998     (?: @ (?: [\040\t] | \(
2999     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3000     \) )* (?:
3001     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3002     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3003     | \[ # [
3004     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3005     \] # ]
3006     ) # initial subdomain
3007     (?: #
3008     (?: [\040\t] | \(
3009     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3010     \) )* \. # if led by a period...
3011     (?: [\040\t] | \(
3012     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3013     \) )* (?:
3014     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3015     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3016     | \[ # [
3017     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3018     \] # ]
3019     ) # ...further okay
3020     )*
3021    
3022     (?: (?: [\040\t] | \(
3023     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3024     \) )* , (?: [\040\t] | \(
3025     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3026     \) )* @ (?: [\040\t] | \(
3027     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3028     \) )* (?:
3029     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3030     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3031     | \[ # [
3032     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3033     \] # ]
3034     ) # initial subdomain
3035     (?: #
3036     (?: [\040\t] | \(
3037     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3038     \) )* \. # if led by a period...
3039     (?: [\040\t] | \(
3040     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3041     \) )* (?:
3042     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3043     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3044     | \[ # [
3045     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3046     \] # ]
3047     ) # ...further okay
3048     )*
3049     )* # further okay, if led by comma
3050     : # closing colon
3051     (?: [\040\t] | \(
3052     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3053     \) )* )? # optional route
3054     (?:
3055     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3056     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3057     |
3058     " (?: # opening quote...
3059     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
3060     | # or
3061     \\ [^\x80-\xff] # Escaped something (something != CR)
3062     )* " # closing quote
3063     ) # initial word
3064     (?: (?: [\040\t] | \(
3065     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3066     \) )* \. (?: [\040\t] | \(
3067     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3068     \) )* (?:
3069     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3070     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3071     |
3072     " (?: # opening quote...
3073     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
3074     | # or
3075     \\ [^\x80-\xff] # Escaped something (something != CR)
3076     )* " # closing quote
3077     ) )* # further okay, if led by a period
3078     (?: [\040\t] | \(
3079     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3080     \) )* @ (?: [\040\t] | \(
3081     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3082     \) )* (?:
3083     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3084     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3085     | \[ # [
3086     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3087     \] # ]
3088     ) # initial subdomain
3089     (?: #
3090     (?: [\040\t] | \(
3091     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3092     \) )* \. # if led by a period...
3093     (?: [\040\t] | \(
3094     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3095     \) )* (?:
3096     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
3097     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
3098     | \[ # [
3099     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
3100     \] # ]
3101     ) # ...further okay
3102     )*
3103     # address spec
3104     (?: [\040\t] | \(
3105     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3106     \) )* > # trailing >
3107     # name and address
3108     ) (?: [\040\t] | \(
3109     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
3110     \) )* # optional trailing comment
3111     /xSI
3112    
3113     /<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
3114    
3115     "(?>.*/)foo"SI
3116    
3117     /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
3118    
3119     /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
3120    
3121     /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
3122    
3123     /<a[\s]+href[\s]*=[\s]* # find <a href=
3124     ([\"\'])? # find single or double quote
3125     (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
3126     # quote, otherwise match up to next space
3127     /isxSI
3128    
3129     /^(?!:) # colon disallowed at start
3130     (?: # start of item
3131     (?: [0-9a-f]{1,4} | # 1-4 hex digits or
3132     (?(1)0 | () ) ) # if null previously matched, fail; else null
3133     : # followed by colon
3134     ){1,7} # end item; 1-7 of them required
3135     [0-9a-f]{1,4} $ # final hex number at end of string
3136     (?(1)|.) # check that there was an empty component
3137     /xiIS
3138    
3139 ph10 457 /(?|(?<a>A)|(?<a>B))/I
3140     AB\Ca
3141     BA\Ca
3142    
3143     /(?|(?<a>A)|(?<b>B))/
3144    
3145 ph10 459 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
3146     b(?<quote> (?<apostrophe>')|(?<realquote>")) )
3147     (?('quote')[a-z]+|[0-9]+)/JIx
3148     a"aaaaa
3149     b"aaaaa
3150     ** Failers
3151     b"11111
3152     a"11111
3153    
3154 ph10 461 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
3155 ph10 459 abcdX
3156     eX
3157     ** Failers
3158     abcdY
3159     ey
3160    
3161 ph10 461 /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/JDZx
3162 ph10 459 abcdd
3163     ** Failers
3164     abcdde
3165    
3166 ph10 462 /abcd*/
3167     xxxxabcd\P
3168     xxxxabcd\P\P
3169    
3170     /abcd*/i
3171     xxxxabcd\P
3172     xxxxabcd\P\P
3173     XXXXABCD\P
3174     XXXXABCD\P\P
3175    
3176     /abc\d*/
3177     xxxxabc1\P
3178     xxxxabc1\P\P
3179    
3180     /(a)bc\1*/
3181     xxxxabca\P
3182     xxxxabca\P\P
3183    
3184     /abc[de]*/
3185     xxxxabcde\P
3186     xxxxabcde\P\P
3187    
3188 ph10 559 /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
3189     broken and not behaving as specified in that it *does* bumpalong after
3190     hitting (*COMMIT). --/
3191 ph10 464
3192     /(?1)(A(*COMMIT)|B)D/
3193     ABD
3194     XABD
3195     BAD
3196     ABXABD
3197     ** Failers
3198     ABX
3199     BAXBAD
3200    
3201 ph10 467 /(\3)(\1)(a)/<JS>
3202     cat
3203    
3204     /(\3)(\1)(a)/SI<JS>
3205     cat
3206    
3207     /(\3)(\1)(a)/SI
3208     cat
3209    
3210 ph10 471 /i(?(DEFINE)(?<s>a))/SI
3211     i
3212    
3213     /()i(?(1)a)/SI
3214     ia
3215    
3216 ph10 472 /(?i)a(?-i)b|c/BZ
3217     XabX
3218     XAbX
3219     CcC
3220     ** Failers
3221     XABX
3222    
3223     /(?i)a(?s)b|c/BZ
3224    
3225     /(?i)a(?s-i)b|c/BZ
3226    
3227 ph10 488 /^(ab(c\1)d|x){2}$/BZ
3228     xabcxd
3229 ph10 496
3230     /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
3231 ph10 488
3232 ph10 496 /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
3233    
3234 ph10 559 / -- The first four of these are not in the Perl >= 5.10 test because Perl
3235 ph10 500 documents that the use of \K in assertions is "not well defined". The
3236     last is here because Perl gives the match as "b" rather than "ab". I
3237     believe this to be a Perl bug. --/
3238    
3239     /(?=a\Kb)ab/
3240     ab
3241    
3242     /(?!a\Kb)ac/
3243     ac
3244    
3245     /^abc(?<=b\Kc)d/
3246     abcd
3247    
3248     /^abc(?<!b\Kq)d/
3249     abcd
3250    
3251     /(?>a\Kb)z|(ab)/
3252     ab
3253    
3254     /----------------------/
3255    
3256 ph10 504 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3257    
3258 ph10 510 /abc(*MARK:)pqr/
3259    
3260     /abc(*:)pqr/
3261    
3262     /abc(*FAIL:123)xyz/
3263    
3264     /--- This should, and does, fail. In Perl, it does not, which I think is a
3265     bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3266    
3267     /A(*COMMIT)B/+K
3268     ACABX
3269    
3270     /--- These should be different, but in Perl 5.11 are not, which I think
3271     is a bug in Perl. ---/
3272    
3273     /A(*THEN)B|A(*THEN)C/K
3274     AC
3275    
3276     /A(*PRUNE)B|A(*PRUNE)C/K
3277     AC
3278    
3279     /--- A whole lot of tests of verbs with arguments are here rather than in test
3280     11 because Perl doesn't seem to follow its specification entirely
3281     correctly. ---/
3282    
3283     /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
3284     not clear how Perl defines "involved in the failure of the match". ---/
3285    
3286     /^(A(*THEN:A)B|C(*THEN:B)D)/K
3287     AB
3288     CD
3289     ** Failers
3290     AC
3291     CB
3292    
3293     /--- Check the use of names for success and failure. PCRE doesn't show these
3294     names for success, though Perl does, contrary to its spec. ---/
3295    
3296     /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
3297     AB
3298     CD
3299     ** Failers
3300     AC
3301     CB
3302    
3303     /--- An empty name does not pass back an empty string. It is the same as if no
3304     name were given. ---/
3305    
3306     /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
3307     AB
3308     CD
3309    
3310     /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
3311    
3312     /A(*PRUNE:A)B/K
3313     ACAB
3314    
3315     /(*MARK:A)(*PRUNE:B)(C|X)/K
3316     C
3317     D
3318    
3319     /(*MARK:A)(*THEN:B)(C|X)/K
3320     C
3321     D
3322    
3323     /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
3324    
3325     /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
3326     AAAC
3327    
3328     /--- Same --/
3329    
3330     /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
3331     AAAC
3332    
3333     /--- This should fail; the SKIP advances by one, but when we get to AC, the
3334     PRUNE kills it. ---/
3335    
3336     /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3337     AAAC
3338    
3339     /A(*:A)A+(*SKIP)(B|Z) | AC/xK
3340     AAAC
3341    
3342     /--- This should fail, as a null name is the same as no name ---/
3343    
3344     /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
3345     AAAC
3346    
3347     /--- This fails in PCRE, and I think that is in accordance with Perl's
3348     documentation, though in Perl it succeeds. ---/
3349    
3350     /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
3351     AAAC
3352    
3353     /--- Mark names can be duplicated ---/
3354    
3355     /A(*:A)B|X(*:A)Y/K
3356     AABC
3357     XXYZ
3358    
3359     /^A(*:A)B|^X(*:A)Y/K
3360     ** Failers
3361     XAQQ
3362    
3363     /--- A check on what happens after hitting a mark and them bumping along to
3364     something that does not even start. Perl reports tags after the failures here,
3365     though it does not when the individual letters are made into something
3366     more complicated. ---/
3367    
3368     /A(*:A)B|XX(*:B)Y/K
3369     AABC
3370     XXYZ
3371     ** Failers
3372     XAQQ
3373     XAQQXZZ
3374     AXQQQ
3375     AXXQQQ
3376    
3377     /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3378     optimizations defeat this. So does the PCRE optimization unless we disable it
3379     with \Y. ---/
3380    
3381     /(*COMMIT)ABC/
3382     ABCDEFG
3383     ** Failers
3384     DEFGABC\Y
3385    
3386     /--- Repeat some tests with added studying. ---/
3387    
3388     /A(*COMMIT)B/+KS
3389     ACABX
3390    
3391     /A(*THEN)B|A(*THEN)C/KS
3392     AC
3393    
3394     /A(*PRUNE)B|A(*PRUNE)C/KS
3395     AC
3396    
3397     /^(A(*THEN:A)B|C(*THEN:B)D)/KS
3398     AB
3399     CD
3400     ** Failers
3401     AC
3402     CB
3403    
3404     /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
3405     AB
3406     CD
3407     ** Failers
3408     AC
3409     CB
3410    
3411     /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
3412     AB
3413     CD
3414    
3415     /A(*PRUNE:A)B/KS
3416     ACAB
3417    
3418     /(*MARK:A)(*PRUNE:B)(C|X)/KS
3419     C
3420     D
3421    
3422     /(*MARK:A)(*THEN:B)(C|X)/KS
3423     C
3424     D
3425    
3426     /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
3427     AAAC
3428    
3429     /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
3430     AAAC
3431    
3432     /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
3433     AAAC
3434    
3435     /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
3436     AAAC
3437    
3438     /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
3439     AAAC
3440    
3441     /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
3442     AAAC
3443    
3444     /A(*:A)B|XX(*:B)Y/KS
3445     AABC
3446     XXYZ
3447     ** Failers
3448     XAQQ
3449     XAQQXZZ
3450     AXQQQ
3451     AXXQQQ
3452    
3453     /(*COMMIT)ABC/
3454     ABCDEFG
3455     ** Failers
3456     DEFGABC\Y
3457    
3458     /^(ab (c+(*THEN)cd) | xyz)/x
3459     abcccd
3460    
3461     /^(ab (c+(*PRUNE)cd) | xyz)/x
3462     abcccd
3463    
3464     /^(ab (c+(*FAIL)cd) | xyz)/x
3465     abcccd
3466 ph10 511
3467     /--- Perl 5.11 gets some of these wrong ---/
3468 ph10 510
3469 ph10 511 /(?>.(*ACCEPT))*?5/
3470     abcde
3471    
3472     /(.(*ACCEPT))*?5/
3473     abcde
3474    
3475     /(.(*ACCEPT))5/
3476     abcde
3477    
3478     /(.(*ACCEPT))*5/
3479     abcde
3480    
3481 ph10 514 /A\NB./BZ
3482 ph10 550 ACBD
3483     *** Failers
3484     A\nB
3485     ACB\n
3486 ph10 514
3487     /A\NB./sBZ
3488 ph10 550 ACBD
3489     ACB\n
3490     *** Failers
3491     A\nB
3492 ph10 514
3493     /A\NB/<crlf>
3494 ph10 550 A\nB
3495     A\rB
3496     ** Failers
3497     A\r\nB
3498 ph10 514
3499 ph10 528 /\R+b/BZ
3500    
3501     /\R+\n/BZ
3502    
3503     /\R+\d/BZ
3504    
3505     /\d*\R/BZ
3506    
3507     /\s*\R/BZ
3508    
3509 ph10 550 /-- Perl treats this one differently, not failing the second string. I believe
3510     that is a bug in Perl. --/
3511    
3512     /^((abc|abcx)(*THEN)y|abcd)/
3513     abcd
3514     *** Failers
3515     abcxy
3516    
3517 ph10 553 /(?<=abc)def/
3518     abc\P\P
3519    
3520     /abc$/
3521     abc
3522     abc\P
3523     abc\P\P
3524    
3525     /abc$/m
3526     abc
3527     abc\n
3528     abc\P\P
3529     abc\n\P\P
3530     abc\P
3531     abc\n\P
3532    
3533     /abc\z/
3534     abc
3535     abc\P
3536     abc\P\P
3537    
3538     /abc\Z/
3539     abc
3540     abc\P
3541     abc\P\P
3542    
3543     /abc\b/
3544     abc
3545     abc\P
3546     abc\P\P
3547    
3548     /abc\B/
3549     abc
3550     abc\P
3551     abc\P\P
3552    
3553 ph10 567 /.+/
3554     abc\>0
3555     abc\>1
3556     abc\>2
3557     abc\>3
3558     abc\>4
3559     abc\>-4
3560    
3561 ph10 574 /^\cģ/
3562    
3563 ph10 578 /(?P<abn>(?P=abn)xxx)/BZ
3564    
3565     /(a\1z)/BZ
3566    
3567     /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
3568    
3569     /(?P<abn>(?P=axn)xxx)/BZ
3570    
3571     /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
3572    
3573 ph10 600 /-- These tests are here because Perl gets the first one wrong. --/
3574    
3575     /(\R*)(.)/s
3576     \r\n
3577     \r\r\n\n\r
3578     \r\r\n\n\r\n
3579    
3580     /(\R)*(.)/s
3581     \r\n
3582     \r\r\n\n\r
3583     \r\r\n\n\r\n
3584    
3585     /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
3586     \r\n
3587     \r\r\n\n\r
3588     \r\r\n\n\r\n
3589    
3590     /-- --/
3591    
3592 ph10 602 /^abc$/BZ
3593    
3594     /^abc$/BZm
3595    
3596 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