1 # This set of tests is for features that are compatible with all versions of
2 # Perl >= 5.10, in non-UTF mode. It should run clean for the 8-bit, 16-bit, and
3 # 32-bit PCRE libraries, and also using the perltest.pl script.
6 #newline_default lf any anycrlf
11 What do you know about the quick brown fox?
14 What do you know about THE QUICK BROWN FOX?
16 /The quick brown fox/i
19 What do you know about the quick brown fox?
20 What do you know about THE QUICK BROWN FOX?
22 /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
23 abcd\t\n\r\f\a\e9;\$\\?caxyz
25 /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
26 abxyzpqrrrabbxyyyypqAzz
27 abxyzpqrrrabbxyyyypqAzz
28 aabxyzpqrrrabbxyyyypqAzz
29 aaabxyzpqrrrabbxyyyypqAzz
30 aaaabxyzpqrrrabbxyyyypqAzz
31 abcxyzpqrrrabbxyyyypqAzz
32 aabcxyzpqrrrabbxyyyypqAzz
33 aaabcxyzpqrrrabbxyyyypAzz
34 aaabcxyzpqrrrabbxyyyypqAzz
35 aaabcxyzpqrrrabbxyyyypqqAzz
36 aaabcxyzpqrrrabbxyyyypqqqAzz
37 aaabcxyzpqrrrabbxyyyypqqqqAzz
38 aaabcxyzpqrrrabbxyyyypqqqqqAzz
39 aaabcxyzpqrrrabbxyyyypqqqqqqAzz
40 aaaabcxyzpqrrrabbxyyyypqAzz
41 abxyzzpqrrrabbxyyyypqAzz
42 aabxyzzzpqrrrabbxyyyypqAzz
43 aaabxyzzzzpqrrrabbxyyyypqAzz
44 aaaabxyzzzzpqrrrabbxyyyypqAzz
45 abcxyzzpqrrrabbxyyyypqAzz
46 aabcxyzzzpqrrrabbxyyyypqAzz
47 aaabcxyzzzzpqrrrabbxyyyypqAzz
48 aaaabcxyzzzzpqrrrabbxyyyypqAzz
49 aaaabcxyzzzzpqrrrabbbxyyyypqAzz
50 aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
51 aaabcxyzpqrrrabbxyyyypABzz
52 aaabcxyzpqrrrabbxyyyypABBzz
53 >>>aaabxyzpqrrrabbxyyyypqAzz
54 >aaaabxyzpqrrrabbxyyyypqAzz
55 >>>>abcxyzpqrrrabbxyyyypqAzz
57 abxyzpqrrabbxyyyypqAzz
58 abxyzpqrrrrabbxyyyypqAzz
59 abxyzpqrrrabxyyyypqAzz
60 aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
61 aaaabcxyzzzzpqrrrabbbxyyypqAzz
62 aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
184 /^.+[0-9][0-9][0-9]$/
192 /^.+?[0-9][0-9][0-9]$/
200 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
201 abc!pqr=apquxz.ixr.zzz.ac.uk
203 !pqr=apquxz.ixr.zzz.ac.uk
204 abc!=apquxz.ixr.zzz.ac.uk
205 abc!pqr=apquxz:ixr.zzz.ac.uk
206 abc!pqr=apquxz.ixr.zzz.ac.ukk
209 Well, we need a colon: somewhere
228 /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
236 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
237 1 IN SOA non-sp1 non-sp2(
238 1 IN SOA non-sp1 non-sp2 (
240 1IN SOA non-sp1 non-sp2(
242 /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
252 /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
263 /^(?=ab(de))(abd)(e)/
266 /^(?!(ab)de|x)(abd)(f)/
272 /^[\da-f](\.[\da-f])*$/i
289 / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
295 /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
308 /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
311 /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
314 /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
376 /\A(abc|def)=(\1){2,3}\Z/
382 /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/
386 /(cat(a(ract|tonic)|erpillar)) \1()2(3)/
388 catatonic catatonic23
389 caterpillar caterpillar23
392 /^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]/
393 From abcd Mon Sep 01 12:33:02 1997
395 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
396 From abcd Mon Sep 01 12:33:02 1997
397 From abcd Mon Sep 1 12:33:02 1997
399 From abcd Sep 01 12:33:02 1997
406 the quick brown\t fox
409 foobar is foolish see?
411 /(?:(?!foo)...|^.{0,2})bar(.*)/
417 /^(\D*)(?=\d)(?!123)/
422 /^1234(?# test newlines
426 /^1234 #comment in extended re
459 /^[ab]{1,3}?(ab*?|b)/
466 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
467 \) )* # optional leading comment
469 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
470 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
472 " (?: # opening quote...
473 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
475 \\ [^\x80-\xff] # Escaped something (something != CR)
478 (?: (?: [\040\t] | \(
479 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
480 \) )* \. (?: [\040\t] | \(
481 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
483 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
484 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
486 " (?: # opening quote...
487 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
489 \\ [^\x80-\xff] # Escaped something (something != CR)
491 ) )* # further okay, if led by a period
493 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
494 \) )* @ (?: [\040\t] | \(
495 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
497 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
498 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
500 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
502 ) # initial subdomain
505 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
506 \) )* \. # if led by a period...
508 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
510 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
511 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
513 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
520 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
521 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
523 " (?: # opening quote...
524 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
526 \\ [^\x80-\xff] # Escaped something (something != CR)
528 ) # one word, optionally followed by....
530 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
532 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
533 \) | # comments, or...
535 " (?: # opening quote...
536 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
538 \\ [^\x80-\xff] # Escaped something (something != CR)
543 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
545 (?: @ (?: [\040\t] | \(
546 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
548 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
549 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
551 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
553 ) # initial subdomain
556 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
557 \) )* \. # if led by a period...
559 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
561 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
562 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
564 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
569 (?: (?: [\040\t] | \(
570 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
571 \) )* , (?: [\040\t] | \(
572 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
573 \) )* @ (?: [\040\t] | \(
574 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
576 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
577 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
579 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
581 ) # initial subdomain
584 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
585 \) )* \. # if led by a period...
587 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
589 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
590 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
592 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
596 )* # further okay, if led by comma
599 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
600 \) )* )? # optional route
602 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
603 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
605 " (?: # opening quote...
606 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
608 \\ [^\x80-\xff] # Escaped something (something != CR)
611 (?: (?: [\040\t] | \(
612 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
613 \) )* \. (?: [\040\t] | \(
614 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
616 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
617 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
619 " (?: # opening quote...
620 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
622 \\ [^\x80-\xff] # Escaped something (something != CR)
624 ) )* # further okay, if led by a period
626 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
627 \) )* @ (?: [\040\t] | \(
628 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
630 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
631 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
633 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
635 ) # initial subdomain
638 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
639 \) )* \. # if led by a period...
641 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
643 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
644 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
646 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
652 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
656 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
657 \) )* # optional trailing comment
659 Alan Other <user\@dom.ain>
662 \"A. Other\" <user.1234\@dom.ain> (a comment)
663 A. Other <user.1234\@dom.ain> (a comment)
664 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
665 A missing angle <user\@some.where
669 /[\040\t]* # Nab whitespace.
672 [^\\\x80-\xff\n\015()] * # normal*
674 (?: \\ [^\x80-\xff] |
676 [^\\\x80-\xff\n\015()] * # normal*
677 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
680 [^\\\x80-\xff\n\015()] * # normal*
683 [\040\t]* )* # If comment found, allow more spaces.
684 # optional leading comment
687 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
688 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
692 [^\\\x80-\xff\n\015"] * # normal
693 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
697 [\040\t]* # Nab whitespace.
700 [^\\\x80-\xff\n\015()] * # normal*
702 (?: \\ [^\x80-\xff] |
704 [^\\\x80-\xff\n\015()] * # normal*
705 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
708 [^\\\x80-\xff\n\015()] * # normal*
711 [\040\t]* )* # If comment found, allow more spaces.
714 [\040\t]* # Nab whitespace.
717 [^\\\x80-\xff\n\015()] * # normal*
719 (?: \\ [^\x80-\xff] |
721 [^\\\x80-\xff\n\015()] * # normal*
722 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
725 [^\\\x80-\xff\n\015()] * # normal*
728 [\040\t]* )* # If comment found, allow more spaces.
730 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
731 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
735 [^\\\x80-\xff\n\015"] * # normal
736 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
740 [\040\t]* # Nab whitespace.
743 [^\\\x80-\xff\n\015()] * # normal*
745 (?: \\ [^\x80-\xff] |
747 [^\\\x80-\xff\n\015()] * # normal*
748 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
751 [^\\\x80-\xff\n\015()] * # normal*
754 [\040\t]* )* # If comment found, allow more spaces.
758 [\040\t]* # Nab whitespace.
761 [^\\\x80-\xff\n\015()] * # normal*
763 (?: \\ [^\x80-\xff] |
765 [^\\\x80-\xff\n\015()] * # normal*
766 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
769 [^\\\x80-\xff\n\015()] * # normal*
772 [\040\t]* )* # If comment found, allow more spaces.
774 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
775 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
778 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
781 [\040\t]* # Nab whitespace.
784 [^\\\x80-\xff\n\015()] * # normal*
786 (?: \\ [^\x80-\xff] |
788 [^\\\x80-\xff\n\015()] * # normal*
789 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
792 [^\\\x80-\xff\n\015()] * # normal*
795 [\040\t]* )* # If comment found, allow more spaces.
796 # optional trailing comments
799 [\040\t]* # Nab whitespace.
802 [^\\\x80-\xff\n\015()] * # normal*
804 (?: \\ [^\x80-\xff] |
806 [^\\\x80-\xff\n\015()] * # normal*
807 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
810 [^\\\x80-\xff\n\015()] * # normal*
813 [\040\t]* )* # If comment found, allow more spaces.
815 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
816 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
819 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
822 [\040\t]* # Nab whitespace.
825 [^\\\x80-\xff\n\015()] * # normal*
827 (?: \\ [^\x80-\xff] |
829 [^\\\x80-\xff\n\015()] * # normal*
830 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
833 [^\\\x80-\xff\n\015()] * # normal*
836 [\040\t]* )* # If comment found, allow more spaces.
837 # optional trailing comments
842 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
843 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
847 [^\\\x80-\xff\n\015"] * # normal
848 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
853 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces
857 [^\\\x80-\xff\n\015()] * # normal*
859 (?: \\ [^\x80-\xff] |
861 [^\\\x80-\xff\n\015()] * # normal*
862 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
865 [^\\\x80-\xff\n\015()] * # normal*
870 [^\\\x80-\xff\n\015"] * # normal
871 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
873 ) # "special" comment or quoted string
874 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal"
877 [\040\t]* # Nab whitespace.
880 [^\\\x80-\xff\n\015()] * # normal*
882 (?: \\ [^\x80-\xff] |
884 [^\\\x80-\xff\n\015()] * # normal*
885 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
888 [^\\\x80-\xff\n\015()] * # normal*
891 [\040\t]* )* # If comment found, allow more spaces.
895 [\040\t]* # Nab whitespace.
898 [^\\\x80-\xff\n\015()] * # normal*
900 (?: \\ [^\x80-\xff] |
902 [^\\\x80-\xff\n\015()] * # normal*
903 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
906 [^\\\x80-\xff\n\015()] * # normal*
909 [\040\t]* )* # If comment found, allow more spaces.
911 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
912 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
915 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
918 [\040\t]* # Nab whitespace.
921 [^\\\x80-\xff\n\015()] * # normal*
923 (?: \\ [^\x80-\xff] |
925 [^\\\x80-\xff\n\015()] * # normal*
926 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
929 [^\\\x80-\xff\n\015()] * # normal*
932 [\040\t]* )* # If comment found, allow more spaces.
933 # optional trailing comments
936 [\040\t]* # Nab whitespace.
939 [^\\\x80-\xff\n\015()] * # normal*
941 (?: \\ [^\x80-\xff] |
943 [^\\\x80-\xff\n\015()] * # normal*
944 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
947 [^\\\x80-\xff\n\015()] * # normal*
950 [\040\t]* )* # If comment found, allow more spaces.
952 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
953 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
956 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
959 [\040\t]* # Nab whitespace.
962 [^\\\x80-\xff\n\015()] * # normal*
964 (?: \\ [^\x80-\xff] |
966 [^\\\x80-\xff\n\015()] * # normal*
967 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
970 [^\\\x80-\xff\n\015()] * # normal*
973 [\040\t]* )* # If comment found, allow more spaces.
974 # optional trailing comments
977 [\040\t]* # Nab whitespace.
980 [^\\\x80-\xff\n\015()] * # normal*
982 (?: \\ [^\x80-\xff] |
984 [^\\\x80-\xff\n\015()] * # normal*
985 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
988 [^\\\x80-\xff\n\015()] * # normal*
991 [\040\t]* )* # If comment found, allow more spaces.
993 [\040\t]* # Nab whitespace.
996 [^\\\x80-\xff\n\015()] * # normal*
998 (?: \\ [^\x80-\xff] |
1000 [^\\\x80-\xff\n\015()] * # normal*
1001 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1004 [^\\\x80-\xff\n\015()] * # normal*
1007 [\040\t]* )* # If comment found, allow more spaces.
1009 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1010 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1013 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1016 [\040\t]* # Nab whitespace.
1019 [^\\\x80-\xff\n\015()] * # normal*
1021 (?: \\ [^\x80-\xff] |
1023 [^\\\x80-\xff\n\015()] * # normal*
1024 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1027 [^\\\x80-\xff\n\015()] * # normal*
1030 [\040\t]* )* # If comment found, allow more spaces.
1031 # optional trailing comments
1034 [\040\t]* # Nab whitespace.
1037 [^\\\x80-\xff\n\015()] * # normal*
1039 (?: \\ [^\x80-\xff] |
1041 [^\\\x80-\xff\n\015()] * # normal*
1042 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1045 [^\\\x80-\xff\n\015()] * # normal*
1048 [\040\t]* )* # If comment found, allow more spaces.
1050 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1051 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1054 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1057 [\040\t]* # Nab whitespace.
1060 [^\\\x80-\xff\n\015()] * # normal*
1062 (?: \\ [^\x80-\xff] |
1064 [^\\\x80-\xff\n\015()] * # normal*
1065 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1068 [^\\\x80-\xff\n\015()] * # normal*
1071 [\040\t]* )* # If comment found, allow more spaces.
1072 # optional trailing comments
1074 )* # additional domains
1076 [\040\t]* # Nab whitespace.
1079 [^\\\x80-\xff\n\015()] * # normal*
1081 (?: \\ [^\x80-\xff] |
1083 [^\\\x80-\xff\n\015()] * # normal*
1084 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1087 [^\\\x80-\xff\n\015()] * # normal*
1090 [\040\t]* )* # If comment found, allow more spaces.
1091 # optional trailing comments
1094 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1095 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1099 [^\\\x80-\xff\n\015"] * # normal
1100 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
1104 [\040\t]* # Nab whitespace.
1107 [^\\\x80-\xff\n\015()] * # normal*
1109 (?: \\ [^\x80-\xff] |
1111 [^\\\x80-\xff\n\015()] * # normal*
1112 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1115 [^\\\x80-\xff\n\015()] * # normal*
1118 [\040\t]* )* # If comment found, allow more spaces.
1121 [\040\t]* # Nab whitespace.
1124 [^\\\x80-\xff\n\015()] * # normal*
1126 (?: \\ [^\x80-\xff] |
1128 [^\\\x80-\xff\n\015()] * # normal*
1129 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1132 [^\\\x80-\xff\n\015()] * # normal*
1135 [\040\t]* )* # If comment found, allow more spaces.
1137 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1138 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1142 [^\\\x80-\xff\n\015"] * # normal
1143 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
1147 [\040\t]* # Nab whitespace.
1150 [^\\\x80-\xff\n\015()] * # normal*
1152 (?: \\ [^\x80-\xff] |
1154 [^\\\x80-\xff\n\015()] * # normal*
1155 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1158 [^\\\x80-\xff\n\015()] * # normal*
1161 [\040\t]* )* # If comment found, allow more spaces.
1165 [\040\t]* # Nab whitespace.
1168 [^\\\x80-\xff\n\015()] * # normal*
1170 (?: \\ [^\x80-\xff] |
1172 [^\\\x80-\xff\n\015()] * # normal*
1173 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1176 [^\\\x80-\xff\n\015()] * # normal*
1179 [\040\t]* )* # If comment found, allow more spaces.
1181 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1182 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1185 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1188 [\040\t]* # Nab whitespace.
1191 [^\\\x80-\xff\n\015()] * # normal*
1193 (?: \\ [^\x80-\xff] |
1195 [^\\\x80-\xff\n\015()] * # normal*
1196 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1199 [^\\\x80-\xff\n\015()] * # normal*
1202 [\040\t]* )* # If comment found, allow more spaces.
1203 # optional trailing comments
1206 [\040\t]* # Nab whitespace.
1209 [^\\\x80-\xff\n\015()] * # normal*
1211 (?: \\ [^\x80-\xff] |
1213 [^\\\x80-\xff\n\015()] * # normal*
1214 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1217 [^\\\x80-\xff\n\015()] * # normal*
1220 [\040\t]* )* # If comment found, allow more spaces.
1222 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1223 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1226 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1229 [\040\t]* # Nab whitespace.
1232 [^\\\x80-\xff\n\015()] * # normal*
1234 (?: \\ [^\x80-\xff] |
1236 [^\\\x80-\xff\n\015()] * # normal*
1237 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1240 [^\\\x80-\xff\n\015()] * # normal*
1243 [\040\t]* )* # If comment found, allow more spaces.
1244 # optional trailing comments
1251 Alan Other <user\@dom.ain>
1254 \"A. Other\" <user.1234\@dom.ain> (a comment)
1255 A. Other <user.1234\@dom.ain> (a comment)
1256 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
1257 A missing angle <user\@some.where
1261 /abc\0def\00pqr\000xyz\0000AB/
1262 abc\0def\00pqr\000xyz\0000AB
1263 abc456 abc\0def\00pqr\000xyz\0000ABCDE
1265 /abc\x0def\x00pqr\x000xyz\x0000AB/
1266 abc\x0def\x00pqr\x000xyz\x0000AB
1267 abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE
1349 /([^.]*)\.([^:]*):[T ]+(.*)/
1350 track1.title:TBlah blah blah
1352 /([^.]*)\.([^:]*):[T ]+(.*)/i
1353 track1.title:TBlah blah blah
1355 /([^.]*)\.([^:]*):[t ]+(.*)/i
1356 track1.title:TBlah blah blah
1466 /^(A)(B)(C)(D)(E)(F)(G)(H)(I)\8\9$/
1474 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/
1477 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
1498 /^([^a])([^\b])([^c]*)([^d]{3,4})/
1566 /\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/
1567 \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377
1569 /P[^*]TAIRE[^*]{1,6}?LL/
1570 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
1572 /P[^*]TAIRE[^*]{1,}?LL/
1573 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
1580 /(\.\d\d((?=0)|\d(?=\d)))/
1590 Food is on the foo table
1593 The food is under the bar in the barn.
1596 The food is under the bar in the barn.
1599 I have 2 numbers: 53147
1602 I have 2 numbers: 53147
1605 I have 2 numbers: 53147
1608 I have 2 numbers: 53147
1611 I have 2 numbers: 53147
1614 I have 2 numbers: 53147
1617 I have 2 numbers: 53147
1620 I have 2 numbers: 53147
1625 /^(\D*)(?=\d)(?!123)/
1653 /\d\d\/\d\d\/\d\d\d\d/
1656 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
1657 word cat dog elephant mussel cow horse canary baboon snake shark otherword
1659 word cat dog elephant mussel cow horse canary baboon snake shark
1661 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
1663 word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
1748 borfle\nbib.gif\nno\n
1751 borfle\nbib.gif\nno\n
1754 borfle\nbib.gif\nno\n
1757 borfle\nbib.gif\nno\n
1812 /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
1815 /^\d\d\d\d\d\d\d\d\d\d\d\d/
1818 /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
1830 /^[abcdefghijklmnopqrstuvwxy0123456789]/
1863 the \"quick\" brown fox
1864 \"the \\\"quick\\\" brown fox\"
1878 /<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>/is
1879 <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR>
1961 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
1963 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
1965 /(?>(\.\d\d[1-9]?))\d+/
1971 /^((?>\w+)|(?>\s+))*$/
1972 now is the time for all good men to come to the aid of the party
1974 this is not a line with only words and spaces!
2000 /((?>[^()]+)|\([^()]*\))+/
2003 /\(((?>[^()]+)|\([^()]+\))+\)/
2007 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2023 /(a b(?x)c d (?-x)e f)/
2061 /(?s-i:more.*than).*million/i
2064 more \n than Million
2067 more \n than \n million
2069 /(?:(?s-i)more.*than).*million/i
2072 more \n than Million
2075 more \n than \n million
2094 /(?<=a(?i)b)(\w\w)c/
2102 /(?:(a)|b)(?(1)A|B)/
2116 # Perl gets this next one wrong if the pattern ends with $; in that case it
2117 # fails to match "12".
2119 /^(?(?=abc)\w{3}:|\d\d)/
2126 /^(?(?!abc)\d\d|\w{3}:)$/
2133 /(?(?<=foo)bar|cat)/
2141 /(?(?<!foo)cat|bar)/
2149 /( \( )? [^()]+ (?(1) \) |) /x
2152 the quick (abcd) fox
2155 /( \( )? [^()]+ (?(1) \) ) /x
2158 the quick (abcd) fox
2178 /((?i)blah)\s+(?i:\1)/
2187 /((?i)blah)\s+(?m)A(?i:\1)/
2255 /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
2268 /(?i:saturday|sunday)/
2288 /^([ab](?i)[cd]|[ef])/
2299 /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
2316 /(?<=(?<!foo)bar)baz/
2324 # The cases of aaaa and aaaaaa are missed out below because Perl does things
2325 # differently. We know that odd, and maybe incorrect, things happen with
2326 # recursive references in Perl, as far as 5.11.3 - see some stuff in test #2.
2345 /^(a\1?)(a\1?)(a\2?)(a\3?)$/
2364 # The following tests are taken from the Perl 5.005 test suite; some of them
2365 # are compatible with 5.004, but I'd rather not have to sort them out.
2699 /[a-zA-Z_][a-zA-Z0-9_]*/
2702 /^a(bc+|b[eh])g|.h$/
2705 /(bc+d$|ef*g.|h?i(j|k))/
2713 /((((((((((a))))))))))/
2716 /((((((((((a))))))))))\10/
2719 /(((((((((a)))))))))/
2722 /multiple words of text/
2728 multiple words, yeah
2769 bbaababbabaaaaabbaaaabba
3033 /[a-zA-Z_][a-zA-Z0-9_]*/i
3036 /^a(bc+|b[eh])g|.h$/i
3039 /(bc+d$|ef*g.|h?i(j|k))/i
3048 /((((((((((a))))))))))/i
3051 /((((((((((a))))))))))\10/i
3054 /(((((((((a)))))))))/i
3057 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i
3060 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i
3063 /multiple words of text/i
3069 MULTIPLE WORDS, YEAH
3119 /a(?:b|c|d){4,5}(.)/
3122 /a(?:b|c|d){4,5}?(.)/
3128 /a(?:b|c|d){6,7}(.)/
3131 /a(?:b|c|d){6,7}?(.)/
3134 /a(?:b|c|d){5,6}(.)/
3137 /a(?:b|c|d){5,6}?(.)/
3140 /a(?:b|c|d){5,7}(.)/
3143 /a(?:b|c|d){5,7}?(.)/
3146 /a(?:b|(c|e){1,2}?|d)+?(.)/
3171 /(?:(f)(o)(o)|(b)(a)(r))*/
3191 /^(?:b|a(?=(.)))*\1/
3308 /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/
3311 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/
3312 caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
3327 /^a (?#xxx) (?#yyy) {3}c/x
3356 /((?s)^a(.))((?m)^b$)/
3408 /^(\()?blah(?(1)(\)))$/
3416 /^(\(+)?blah(?(1)(\)))$/
3495 /((?>[^()]+)|\([^()]*\))+/
3514 /^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/
3534 the.quick.brown.fox-
3535 the.quick.brown.fox.
3536 the.quick.brown.fox_
3537 the.quick.brown.fox+
3539 /(?>.*)(?<=(abcd|wxyz))/
3543 a rather long string that doesn't end with one of them
3545 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
3546 word cat dog elephant mussel cow horse canary baboon snake shark otherword
3548 word cat dog elephant mussel cow horse canary baboon snake shark
3550 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
3552 word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
3554 /(?<=\d{3}(?!999))foo/
3560 /(?<=(?!...999)\d{3})foo/
3566 /(?<=\d{3}(?!999)...)foo/
3572 /(?<=\d{3}...)(?<!999)foo/
3578 /<a[\s]+href[\s]*=[\s]* # find <a href=
3579 ([\"\'])? # find single or double quote
3580 (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
3581 # quote, otherwise match up to next space
3584 <a href=\"abcd xyz pqr\" cats
3585 <a href=\'abcd xyz pqr\' cats
3587 /<a\s+href\s*=\s* # find <a href=
3588 (["'])? # find single or double quote
3589 (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching
3590 # quote, otherwise match up to next space
3593 <a href=\"abcd xyz pqr\" cats
3594 <a href = \'abcd xyz pqr\' cats
3596 /<a\s+href(?>\s*)=(?>\s*) # find <a href=
3597 (["'])? # find single or double quote
3598 (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching
3599 # quote, otherwise match up to next space
3602 <a href=\"abcd xyz pqr\" cats
3603 <a href = \'abcd xyz pqr\' cats
3624 > \x09\x0a\x0c\x0d\x0b<
3627 > \x09\x0a\x0c\x0d\x0b<
3630 > \x09\x0a\x0c\x0d\x0b<
3633 > \x09\x0a\x0c\x0d\x0b<
3659 abc#not comment\n literal
3664 abc#not comment\n literal
3668 literal\E #more comment
3670 abc#not comment\n literal
3674 literal\E #more comment/x
3675 abc#not comment\n literal
3699 /((?x)x y z | a b c)/
3729 # This tests for an IPv6 address in the form where it can have up to
3730 # eight components, one and only one of which is empty. This must be
3731 # an internal component.
3733 /^(?!:) # colon disallowed at start
3735 (?: [0-9a-f]{1,4} | # 1-4 hex digits or
3736 (?(1)0 | () ) ) # if null previously matched, fail; else null
3737 : # followed by colon
3738 ){1,7} # end item; 1-7 of them required
3739 [0-9a-f]{1,4} $ # final hex number at end of string
3740 (?(1)|.) # check that there was an empty component
3744 a123:b342::324e:abcd
3745 a123:ddde:b342::324e:abcd
3746 a123:ddde:b342::324e:dcba:abcd
3747 a123:ddde:9999:b342::324e:dcba:abcd
3750 a123:bce:ddde:9999:b342::324e:dcba:abcd
3751 a123::9999:b342::324e:dcba:abcd
3769 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3771 /(?i)reg(?:ul(?:[aä]|ae)r|ex)/
3819 /(?:(?(1)\1a|b)(X|Y))+/
3823 /()()()()()()()()()(?:(?(10)\10a|b)(X|Y))+/
3834 "(?x)(?-x: \s*#\s*)"
3839 "(?x-is)(?:(?-ixs) \s*#\s*) include"
3934 /(a){0,3}(?(1)b|(c|))*D/
3940 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
3942 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3945 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
3947 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3950 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
3952 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3957 /^(?s)(?>.*)(?<!\n)/
3975 /( (A | (?(1)0|) )* )/x
3978 /( ( (?(1)0|) )* )/x
4022 /^%((?(?=[a])[^%])|b)*%$/
4106 /(?:(?>(a))b|(a)c)++/
4109 /(?=(?>(a))b|(a)c)(..)/
4115 /(?:(?>([ab])))+a=/aftertext
4118 /(?>([ab]))+a=/aftertext
4121 /((?>(a+)b)+(aabab))/
4152 /(?=abc){3}abc/aftertext
4157 /(?=abc)+abc/aftertext
4162 /(?=abc)++abc/aftertext
4182 /^(?=(?1))?[az]([abc])d/
4271 \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
4272 \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
4273 \x09\x20\xa0\x0a\x0b\x0c
4275 \x09\x20\xa0\x0a\x0b
4291 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
4292 >XY\x0aZ\x0aA\x0bNN\x0c
4293 >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
4305 /abc\K|def\K/g,aftertext
4308 /ab\Kc|de\Kf/g,aftertext
4319 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-2}Z/
4322 /(?<A>tom|bon)-\g{A}/
4337 /(?|(abc)|(xyz))(?1)/
4343 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/
4346 /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/
4349 /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/
4352 /(?'abc'\w+):\k<abc>{2}/
4359 /(?'abc'\w+):\g{abc}{2}/
4366 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x
4376 /^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x
4379 /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
4386 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/
4394 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/
4403 now is the time for all good men to come to the aid of the party
4405 this is not a line with only words and spaces!
4421 /([^()]++|\([^()]*\))+/
4424 /\(([^()]++|\([^()]+\))+\)/
4428 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
4430 /^([^()]|\((?1)*\))*$/
4437 /^>abc>([^()]|\((?1)*\))*<xyz<$/
4442 /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
4444 Satanoscillatemymetallicsonatas
4445 AmanaplanacanalPanama
4450 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/
4464 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x
4482 /a+b?(*PRUNE)c+(*FAIL)/
4486 /a+b?(*COMMIT)c+(*FAIL)/
4490 /a+b?(*SKIP)c+(*FAIL)/
4494 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
4503 /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
4512 /a+b?(*THEN)c+(*FAIL)/
4516 /(A (A|B(*ACCEPT)|C) D)(E)/x
4524 /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
4526 Satan, oscillate my metallic sonatas!
4527 A man, a plan, a canal: Panama!
4528 Able was I ere I saw Elba.
4553 /(?<X>a)(?<=b(?&X))/
4556 /^(?|(abc)|(def))\1/
4563 /^(?|(abc)|(def))(?1)/
4570 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/x,dupnames
4576 /(?:(?1)|B)(A(*F)|C)/
4582 /^(?:(?1)|B)(A(*F)|C)/
4590 /(?:(?1)|B)(A(*ACCEPT)XX|C)D/
4600 /(?(DEFINE)(A))B(?1)C/
4603 /(?(DEFINE)((A)\2))B(?1)C/
4606 /(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x
4636 /^(?&t)(?(DEFINE)(?<t>a\Kb))$/
4639 /^([^()]|\((?1)*\))*$/
4643 /(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/
4648 /(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/
4653 # This one does fail, as expected, in Perl. It needs the complex item at the
4654 # end of the pattern. A single letter instead of (B|D) makes it not fail, which
4655 # I think is a Perl bug.
4661 # Check the use of names for failure
4663 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
4668 /(*MARK:A)(*SKIP:B)(C|X)/mark
4673 /^(A(*THEN:A)B|C(*THEN:B)D)/mark
4677 /^(?:A(*THEN:A)B|C(*THEN:B)D)/mark
4681 /^(?>A(*THEN:A)B|C(*THEN:B)D)/mark
4685 # This should succeed, as the skip causes bump to offset 1 (the mark). Note
4686 # that we have to have something complicated such as (B|Z) at the end because,
4687 # for Perl, a simple character somehow causes an unwanted optimization to mess
4688 # with the handling of backtracking verbs.
4690 /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/x,mark
4693 # Test skipping over a non-matching mark.
4695 /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/x,mark
4698 # Check shorthand for MARK.
4700 /A(*:A)A+(*SKIP:A)(B|Z) | AC/x,mark
4703 /(*:A)A+(*SKIP:A)(B|Z)/mark
4707 # This should succeed, as a non-existent skip name disables the skip.
4709 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/x,mark
4712 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/x,mark
4715 # COMMIT at the start of a pattern should act like an anchor. Again, however,
4716 # we need the complication for Perl.
4718 /(*COMMIT)(A|P)(B|P)(C|P)/
4723 # COMMIT inside an atomic group can't stop backtracking over the group.
4725 /(\w+)(?>b(*COMMIT))\w{2}/
4728 /(\w+)b(*COMMIT)\w{2}/
4732 # Check opening parens in comment when seeking forward reference.
4734 /(?&t)(?#()(?(DEFINE)(?<t>a))/
4737 # COMMIT should override THEN.
4739 /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
4743 /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
4759 /(?P<abn>(?P=abn)xxx|)+/
4771 /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
4776 /^(?&t)*(?(DEFINE)(?<t>a))\w$/
4842 /(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x
4843 foo(bar(baz)+baz(bop))
4845 /(A (A|B(*ACCEPT)|C) D)(E)/x
4863 /(?(?=(a(*ACCEPT)z))a)/
4879 /(?(DEFINE)(a))?b(?1)/
4910 /(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/
4915 # Checking revised (*THEN) handling.
4919 /^.*? (a(*THEN)b) c/x
4923 /^.*? (a(*THEN)b|(*F)) c/x
4926 /^.*? ( (a(*THEN)b) | (*F) ) c/x
4929 /^.*? ( (a(*THEN)b) ) c/x
4935 /^.*? (?:a(*THEN)b) c/x
4939 /^.*? (?:a(*THEN)b|(*F)) c/x
4942 /^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
4945 /^.*? (?: (?:a(*THEN)b) ) c/x
4951 /^.*? (?>a(*THEN)b) c/x
4955 /^.*? (?>a(*THEN)b|(*F)) c/x
4958 /^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
4961 /^.*? (?> (?>a(*THEN)b) ) c/x
4965 # Possessive capture
4967 /^.*? (a(*THEN)b)++ c/x
4971 /^.*? (a(*THEN)b|(*F))++ c/x
4974 /^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
4977 /^.*? ( (a(*THEN)b)++ )++ c/x
4981 # Possessive non-capture
4983 /^.*? (?:a(*THEN)b)++ c/x
4987 /^.*? (?:a(*THEN)b|(*F))++ c/x
4990 /^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
4993 /^.*? (?: (?:a(*THEN)b)++ )++ c/x
4997 # Condition assertion
4999 /^(?(?=a(*THEN)b)ab|ac)/
5004 /^.*?(?(?=a)a|b(*THEN)c)/
5008 /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
5011 /^.*?(?(?=a)a(*THEN)b|c)/
5020 # --------------------------
5022 /(?>a(*:m))/imsx,mark
5025 /(?>(a)(*:m))/imsx,mark
5031 /(?<=(a(*ACCEPT)b))c/
5034 /(?<=(a(*COMMIT)b))c/
5058 /(*MARK:A)(*PRUNE:B)(C|X)/mark
5063 /(*MARK:A)(*PRUNE:B)(C|X)/mark
5068 /(*MARK:A)(*THEN:B)(C|X)/mark
5073 /(*MARK:A)(*THEN:B)(C|X)/mark,no_start_optimize
5078 /(*MARK:A)(*THEN:B)(C|X)/mark
5083 # This should fail, as the skip causes a bump to offset 3 (the skip).
5085 /A(*MARK:A)A+(*SKIP)(B|Z) | AC/x,mark
5091 /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/x,mark
5095 /A(*:A)A+(*SKIP)(B|Z) | AC/x,mark
5099 # This should fail, as a null name is the same as no name.
5101 /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/x,mark
5105 # A check on what happens after hitting a mark and them bumping along to
5106 # something that does not even start. Perl reports tags after the failures
5107 # here, though it does not when the individual letters are made into something
5110 /A(*:A)B|XX(*:B)Y/mark
5119 /^(A(*THEN:A)B|C(*THEN:B)D)/mark
5126 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
5133 # An empty name does not pass back an empty string. It is the same as if no
5136 /^(A(*PRUNE:)B|C(*PRUNE:B)D)/mark
5140 # PRUNE goes to next bumpalong; COMMIT does not.
5145 # Mark names can be duplicated.
5147 /A(*:A)B|X(*:A)Y/mark
5151 /b(*:m)f|a(*:n)w/mark
5162 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/x,mark
5165 /(?=a(*MARK:A)b)..x/mark
5170 /(?=a(*MARK:A)b)..(*:Y)x/mark
5175 /(?=a(*PRUNE:A)b)..x/mark
5180 /(?=a(*PRUNE:A)b)..(*:Y)x/mark
5185 /(?=a(*THEN:A)b)..x/mark
5190 /(?=a(*THEN:A)b)..(*:Y)x/mark
5195 /(another)?(\1?)test/
5198 /(another)?(\1+)test/
5202 /(a(*COMMIT)b){0}a(?1)|aac/
5227 /(?>.*?)(?<=(abcd)|(wxyz))/
5231 /(?>.*)(?<=(abcd)|(wxyz))/
5242 /(?:(a(*PRUNE)b)){0}(?:(?1)|ac)/
5245 /(?:(a(*SKIP)b)){0}(?:(?1)|ac)/
5252 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/x,mark
5255 /a(*SKIP:m)x|ac(*:n)(*SKIP:n)d|ac/mark
5258 /A(*SKIP:m)x|A(*SKIP:n)x|AB/mark
5261 /((*SKIP:r)d){0}a(*SKIP:m)x|ac(*:n)|ac/mark
5264 # Tests that try to figure out how Perl works. My hypothesis is that the first
5265 # verb that is backtracked onto is the one that acts. This seems to be the case
5266 # almost all the time, but there is one exception that is perhaps a bug.
5268 # This matches "aaaac"; each PRUNE advances one character until the subject no
5269 # longer starts with 5 'a's.
5271 /aaaaa(*PRUNE)b|a+c/
5274 # Putting SKIP in front of PRUNE makes no difference, as it is never
5275 # backtracked onto, whether or not it has a label.
5277 /aaaaa(*SKIP)(*PRUNE)b|a+c/
5280 /aaaaa(*SKIP:N)(*PRUNE)b|a+c/
5283 /aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c/
5286 # Putting THEN in front makes no difference.
5288 /aaaaa(*THEN)(*PRUNE)b|a+c/
5291 # However, putting COMMIT in front of the prune changes it to "no match". I
5292 # think this is inconsistent and possibly a bug. For the moment, running this
5293 # test is moved out of the Perl-compatible file.
5295 /aaaaa(*COMMIT)(*PRUNE)b|a+c/
5297 # OK, lets play the same game again using SKIP instead of PRUNE.
5299 # This matches "ac" because SKIP forces the next match to start on the
5305 # Putting PRUNE in front makes no difference.
5307 /aaaaa(*PRUNE)(*SKIP)b|a+c/
5310 # Putting THEN in front makes no difference.
5312 /aaaaa(*THEN)(*SKIP)b|a+c/
5315 # In this case, neither does COMMIT. This still matches "ac".
5317 /aaaaa(*COMMIT)(*SKIP)b|a+c/
5320 # This gives "no match", as expected.
5322 /aaaaa(*COMMIT)b|a+c/
5326 # ---- Tests using THEN ----
5328 # This matches "aaaaaac", as expected.
5333 # Putting SKIP in front makes no difference.
5335 /aaaaa(*SKIP)(*THEN)b|a+c/
5338 # Putting PRUNE in front makes no difference.
5340 /aaaaa(*PRUNE)(*THEN)b|a+c/
5343 # Putting COMMIT in front makes no difference.
5345 /aaaaa(*COMMIT)(*THEN)b|a+c/
5348 # End of "priority" tests
5350 /aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+/
5353 /aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
5356 /aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+/
5359 /aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
5362 /a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c/
5365 /a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c/
5368 /aaa(*PRUNE:A)a(*SKIP:A)b|a+c/
5371 /aaa(*MARK:A)a(*SKIP:A)b|a+c/
5374 /a(*:m)a(*COMMIT)(*SKIP:m)b|a+c/mark
5380 /(a(*COMMIT)b)c|abd/
5385 /(?=a(*COMMIT)b)abc|abd/
5389 /(?>a(*COMMIT)b)c|abd/
5393 /a(?=b(*COMMIT)c)[^d]|abd/
5402 /a(?>b(*COMMIT)c)d|abd/
5409 /(?>a(*COMMIT)b)c|abd/
5412 /(?>a(*COMMIT)c)d|abd/
5416 /((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
5419 # These tests were formerly in test 2, but changes in PCRE and Perl have
5420 # made them compatible.
5438 /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/x,mark
5442 /^((abc|abcx)(*THEN)y|abcd)/
5447 /^((yes|no)(*THEN)(*F))?/
5451 /(A (.*) C? (*THEN) | A D) (*FAIL)/x
5455 /(A (.*) C? (*THEN) | A D) z/x
5459 /(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x
5463 /(A (.*) C? (*THEN) | A D) \s* z/x
5467 /(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x
5471 /(A (.*) (?:C|) (*THEN) | A D) z/x
5475 /(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x
5479 /(A (.*) C{0,6} (*THEN) | A D) z/x
5483 /(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x
5487 /(A (.*) (CE){0,6} (*THEN) | A D) z/x
5491 /(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x
5495 /(A (.*) (CE*){0,6} (*THEN) | A D) z/x
5499 /(?=a(*COMMIT)b|ac)ac|ac/
5503 /(?=a(*COMMIT)b|(ac)) ac | (a)c/x
5509 /(?(?!b(*THEN)a)bn|bnn)/
5512 /(?!b(*SKIP)a)bn|bnn/
5515 /(?(?!b(*SKIP)a)bn|bnn)/
5518 /(?!b(*PRUNE)a)bn|bnn/
5521 /(?(?!b(*PRUNE)a)bn|bnn)/
5524 /(?!b(*COMMIT)a)bn|bnn/
5527 /(?(?!b(*COMMIT)a)bn|bnn)/
5530 /(?=b(*SKIP)a)bn|bnn/
5534 /(?=b(*THEN)a)bn|bnn/
5555 /(?!a(*COMMIT)b)ac|cd/
5561 /^(A(*THEN)B|C(*THEN)D)/
5564 /(*:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
5567 /(*PRUNE:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
5570 /(*SKIP:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
5573 /(*THEN:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
5601 /(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
5605 /(?<n>A)(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
5612 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
5613 1 IN SOA non-sp1 non-sp2(
5615 /^ (?:(?<A>A)|(?'B'B)(?<A>A)) (?('A')x) (?(<B>)y)$/x,dupnames
5637 / ^ (?> a + ) b $ /x
5640 / ^ ( a + ) + + \w $ /x
5643 /(?:a\Kb)*+/aftertext
5646 /(?>a\Kb)*/aftertext
5649 /(?:a\Kb)*/aftertext
5658 /(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/
5662 '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
5663 NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
5665 '\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
5666 NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
5668 '\A(?:[^\"]++|\"(?:[^\"]++|\"\")++\")++'
5669 NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
5671 '\A([^\"1]++|[\"2]([^\"3]*+|[\"4][\"5])*+[\"6])++'
5672 NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
5674 /^\w+(?>\s*)(?<=\w)/
5677 /(?P<same>a)(?P<same>b)/g,dupnames
5680 /(?P<same>a)(?P<same>b)(?P=same)/g,dupnames
5683 /(?P=same)?(?P<same>a)(?P<same>b)/g,dupnames
5686 /(?:(?P=same)?(?:(?P<same>a)|(?P<same>b))(?P=same))+/g,dupnames
5689 /(?:(?P=same)?(?:(?P=same)(?P<same>a)(?P=same)|(?P=same)?(?P<same>b)(?P=same)){2}(?P=same)(?P<same>c)(?P=same)){2}(?P<same>z)?/g,dupnames
5693 /(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l/
5708 /A((((((((a))))))))\8B/
5711 /A(((((((((a)))))))))\9B/
5722 /(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))/
5735 /((((((((((((x))))))))))))\12/
5741 /(?1)()((((((\1++))\x85)+)|))/
5744 "(?|(\k'Pm')|(?'Pm'))"
5747 /(?|(aaa)|(b))\g{1}/
5761 /(?|(?'a'aaa)|(?'a'b))\k'a'/
5765 /(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/dupnames
5769 # /x does not apply to MARK labels
5771 /x (*MARK:ab cd # comment
5778 /(?<DEFINE>b)(?(DEFINE)(a+))(?&DEFINE)/
5783 /(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\s])/
5792 /(Z)(a)\2{1,2}?(?-i)\1X/i
5795 /(?'c')XX(?'YYYYYYYYYYYYYYYYYYYYYYYCl')/
5800 /[s[:digit:]\Q\E-H]+/
5808 /(?1)(A(*COMMIT)|B)D/
5816 /(?(DEFINE)(?<m> 1? (?=(?<cond>2)?) 1 2 (?('cond')|3)))
5824 (?: A| (1? (?=(?<cond>2)?) (1) 2 (?('cond')|3)) )
5831 /^ (?(DEFINE) ( (?!(a)\2b)..) ) ()(?1) /x
5836 '(?>ab|abab){1,5}?M'
5837 abababababababababababM
5882 /^(?(?=(a))abc|def)/
5885 /^(?(?!(a))def|abc)/
5888 /^(?(?=(a)(*ACCEPT))abc|def)/
5891 /^(?(?!(a)(*ACCEPT))def|abc)/
5897 # This pattern uses a lot of named subpatterns in order to match email
5898 # addresses in various formats. It's a heavy test for named subpatterns. In the
5899 # <atext> group, slash is coded as \x{2f} so that this pattern can also be
5900 # processed by perltest.sh, which does not cater for an escaped delimiter
5901 # within the pattern. $ within the pattern must also be escaped. All $ and @
5902 # characters in subject strings are escaped so that Perl doesn't interpret them
5903 # as variable insertions and " characters must also be escaped for Perl.
5905 # This set of subpatterns is more or less a direct transliteration of the BNF
5906 # definitions in RFC2822, without any of the obsolete features. The addition of
5907 # a possessive + to the definition of <phrase> reduced the match limit in PCRE2
5908 # from over 5 million to just under 400, and eliminated a very noticeable delay
5909 # when this file was passed to perltest.sh.
5912 (?<addr_spec> (?&local_part) \@ (?&domain) )
5913 (?<angle_addr> (?&CFWS)?+ < (?&addr_spec) > (?&CFWS)?+ )
5914 (?<atext> [a-z\d!#\$%&'*+-\x{2f}=?^_`{|}~] )
5915 (?<atom> (?&CFWS)?+ (?&atext)+ (?&CFWS)?+ )
5916 (?<ccontent> (?&ctext) | (?"ed_pair) | (?&comment) )
5917 (?<ctext> [^\x{9}\x{10}\x{13}\x{7f}-\x{ff}\ ()\\] )
5918 (?<comment> \( (?: (?&FWS)?+ (?&ccontent) )*+ (?&FWS)?+ \) )
5919 (?<CFWS> (?: (?&FWS)?+ (?&comment) )* (?# NOT possessive)
5920 (?: (?&FWS)?+ (?&comment) | (?&FWS) ) )
5921 (?<dcontent> (?&dtext) | (?"ed_pair) )
5922 (?<display_name> (?&phrase) )
5923 (?<domain> (?&dot_atom) | (?&domain_literal) )
5924 (?<domain_literal> (?&CFWS)?+ \[ (?: (?&FWS)?+ (?&dcontent) )* (?&FWS)?+ \]
5926 (?<dot_atom> (?&CFWS)?+ (?&dot_atom_text) (?&CFWS)?+ )
5927 (?<dot_atom_text> (?&atext)++ (?: \. (?&atext)++)*+ )
5928 (?<dtext> [^\x{9}\x{10}\x{13}\x{7f}-\x{ff}\ \[\]\\] )
5929 (?<FWS> (?: [\t\ ]*+ \n)?+ [\t\ ]++ )
5930 (?<local_part> (?&dot_atom) | (?"ed_string) )
5931 (?<mailbox> (?&name_addr) | (?&addr_spec) )
5932 (?<name_addr> (?&display_name)? (?&angle_addr) )
5933 (?<phrase> (?&word)++ )
5934 (?<qcontent> (?&qtext) | (?"ed_pair) )
5935 (?<quoted_pair> " (?&text) )
5936 (?<quoted_string> (?&CFWS)?+ " (?: (?&FWS)?+ (?&qcontent))* (?&FWS)?+ "
5938 (?<qtext> [^\x{9}\x{10}\x{13}\x{7f}-\x{ff}\ "\\] )
5940 (?<word> (?&atom) | (?"ed_string) )
5943 Alan Other <user\@dom.ain>
5947 user\@[domain literal]
5948 user\@[domain literal with \"[square brackets\"] inside]
5949 \"A. Other\" <user.1234\@dom.ain> (a comment)
5950 A. Other <user.1234\@dom.ain> (a comment)
5951 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
5953 A missing angle <user\@some.where
5956 # --------------------------------------------------------------------------
5958 # This pattern uses named groups to match default PCRE2 patterns. It's another
5959 # heavy test for named subpatterns. Once again, code slash as \x{2f} and escape
5960 # $ even in classes so that this works with pcre2test.
5964 (?<assertion> (?&simple_assertion) | (?&lookaround) )
5966 (?<atomic_group> \( \? > (?®ex) \) )
5968 (?<back_reference> \\ \d+ |
5969 \\g (?: [+-]?\d+ | \{ (?: [+-]?\d+ | (?&groupname) ) \} ) |
5970 \\k <(?&groupname)> |
5971 \\k '(?&groupname)' |
5972 \\k \{ (?&groupname) \} |
5973 \( \? P= (?&groupname) \) )
5975 (?<branch> (?:(?&assertion) |
5978 (?&option_setting) |
5979 (?&qualified_item) |
5981 (?"ed_string_empty) |
5982 (?&special_escape) |
5986 (?<callout> \(\?C (?: \d+ |
5987 (?: (?<D>["'`^%\#\$])
5988 (?: \k'D'\k'D' | (?!\k'D') . )* \k'D' |
5989 \{ (?: \}\} | [^}]*+ )* \} )
5992 (?<capturing_group> \( (?: \? P? < (?&groupname) > | \? ' (?&groupname) ' )?
5995 (?<character_class> \[ \^?+ (?: \] (?&class_item)* | (?&class_item)+ ) \] )
5997 (?<character_type> (?! \\N\{\w+\} ) \\ [dDsSwWhHvVRN] )
5999 (?<class_item> (?: \[ : (?:
6000 alnum|alpha|ascii|blank|cntrl|digit|graph|lower|print|
6001 punct|space|upper|word|xdigit
6004 (?"ed_string_empty) |
6005 (?&escaped_character) |
6006 (?&character_type) |
6009 (?<comment> \(\?\# [^)]* \) | (?"ed_string_empty) | \\E )
6011 (?<condition> (?: \( [+-]? \d+ \) |
6012 \( < (?&groupname) > \) |
6013 \( ' (?&groupname) ' \) |
6015 \( R & (?&groupname) \) |
6016 \( (?&groupname) \) |
6018 \( VERSION >?=\d+(?:\.\d\d?)? \) |
6019 (?&callout)?+ (?&comment)* (?&lookaround) ) )
6021 (?<conditional_group> \(\? (?&condition) (?&branch) (?: \| (?&branch) )? \) )
6023 (?<delimited_regex> (?<delimiter> [-\x{2f}!"'`=_:;,%&@~]) (?®ex)
6026 (?<escaped_character> \\ (?: 0[0-7]{1,2} | [0-7]{1,3} | o\{ [0-7]+ \} |
6027 x \{ (*COMMIT) [[:xdigit:]]* \} | x [[:xdigit:]]{0,2} |
6028 [aefnrt] | c[[:print:]] |
6031 (?<group> (?&capturing_group) | (?&non_capturing_group) |
6032 (?&resetting_group) | (?&atomic_group) |
6033 (?&conditional_group) )
6035 (?<groupname> [a-zA-Z_]\w* )
6037 (?<literal_character> (?! (?&range_qualifier) ) [^[()|*+?.\$\\] )
6039 (?<lookaround> \(\? (?: = | ! | <= | <! ) (?®ex) \) )
6041 (?<non_capturing_group> \(\? [iJmnsUx-]* : (?®ex) \) )
6043 (?<option_setting> \(\? [iJmnsUx-]* \) )
6045 (?<qualified_item> (?:\. |
6047 (?&back_reference) |
6048 (?&character_class) |
6049 (?&character_type) |
6050 (?&escaped_character) |
6052 (?&subroutine_call) |
6053 (?&literal_character) |
6055 ) (?&comment)? (?&qualifier)? )
6057 (?<qualifier> (?: [?*+] | (?&range_qualifier) ) [+?]? )
6059 (?<quoted_string> (?: \\Q (?: (?!\\E | \k'delimiter') . )++ (?: \\E | ) ) )
6061 (?<quoted_string_empty> \\Q\\E )
6063 (?<range_qualifier> \{ (?: \d+ (?: , \d* )? | , \d+ ) \} )
6065 (?<regex> (?&start_item)* (?&branch) (?: \| (?&branch) )* )
6067 (?<resetting_group> \( \? \| (?®ex) \) )
6069 (?<simple_assertion> \^ | \$ | \\A | \\b | \\B | \\G | \\z | \\Z )
6071 (?<special_escape> \\K )
6073 (?<start_item> \( \* (?:
6094 (?<subroutine_call> (?: \(\?R\) | \(\?[+-]?\d+\) |
6095 \(\? (?: & | P> ) (?&groupname) \) |
6096 \\g < (?&groupname) > |
6097 \\g ' (?&groupname) ' |
6101 (?<verb> \(\* (?: ACCEPT | FAIL | F | COMMIT |
6102 (?:MARK)?:(?&verbname) |
6103 (?:PRUNE|SKIP|THEN) (?: : (?&verbname)? )? ) \) )
6105 (?<verbname> [^)]+ )
6108 # Kick it all off...
6109 ^(?&delimited_regex)$/subject_literal,jitstack=256
6110 /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/
6111 /(cat(a(ract|tonic)|erpillar)) \1()2(3)/
6112 /^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]/
6113 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
6114 /<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>/is
6115 /^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /
6116 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/
6117 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/
6119 /a+b?(*THEN)c+(*FAIL)/
6120 /(A (A|B(*ACCEPT)|C) D)(E)/x
6121 /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
6122 /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/B
6123 /(?C`a``b`)(?C'a''b')(?C"a""b")(?C^a^^b^)(?C%a%%b%)(?C#a##b#)(?C$a$$b$)(?C{a}}b})/B,callout_info
6124 /(?sx)(?(DEFINE)(?<assertion> (?&simple_assertion) | (?&lookaround) )(?<atomic_group> \( \? > (?®ex) \) )(?<back_reference> \\ \d+ | \\g (?: [+-]?\d+ | \{ (?: [+-]?\d+ | (?&groupname) ) \} ) | \\k <(?&groupname)> | \\k '(?&groupname)' | \\k \{ (?&groupname) \} | \( \? P= (?&groupname) \) )(?<branch> (?:(?&assertion) | (?&callout) | (?&comment) | (?&option_setting) | (?&qualified_item) | (?"ed_string) | (?"ed_string_empty) | (?&special_escape) | (?&verb) )* )(?<callout> \(\?C (?: \d+ | (?: (?<D>["'`^%\#\$]) (?: \k'D'\k'D' | (?!\k'D') . )* \k'D' | \{ (?: \}\} | [^}]*+ )* \} ) )? \) )(?<capturing_group> \( (?: \? P? < (?&groupname) > | \? ' (?&groupname) ' )? (?®ex) \) )(?<character_class> \[ \^?+ (?: \] (?&class_item)* | (?&class_item)+ ) \] )(?<character_type> (?! \\N\{\w+\} ) \\ [dDsSwWhHvVRN] )(?<class_item> (?: \[ : (?: alnum|alpha|ascii|blank|cntrl|digit|graph|lower|print| punct|space|upper|word|xdigit ) : \] | (?"ed_string) | (?"ed_string_empty) | (?&escaped_character) | (?&character_type) | [^]] ) )(?<comment> \(\?\# [^)]* \) | (?"ed_string_empty) | \\E )(?<condition> (?: \( [+-]? \d+ \) | \( < (?&groupname) > \) | \( ' (?&groupname) ' \) | \( R \d* \) | \( R & (?&groupname) \) | \( (?&groupname) \) | \( DEFINE \) | \( VERSION >?=\d+(?:\.\d\d?)? \) | (?&callout)?+ (?&comment)* (?&lookaround) ) )(?<conditional_group> \(\? (?&condition) (?&branch) (?: \| (?&branch) )? \) )(?<delimited_regex> (?<delimiter> [-\x{2f}!"'`=_:;,%&@~]) (?®ex) \k'delimiter' .* )(?<escaped_character> \\ (?: 0[0-7]{1,2} | [0-7]{1,3} | o\{ [0-7]+ \} | x \{ (*COMMIT) [[:xdigit:]]* \} | x [[:xdigit:]]{0,2} | [aefnrt] | c[[:print:]] | [^[:alnum:]] ) )(?<group> (?&capturing_group) | (?&non_capturing_group) | (?&resetting_group) | (?&atomic_group) | (?&conditional_group) )(?<groupname> [a-zA-Z_]\w* )(?<literal_character> (?! (?&range_qualifier) ) [^[()|*+?.\$\\] )(?<lookaround> \(\? (?: = | ! | <= | <! ) (?®ex) \) )(?<non_capturing_group> \(\? [iJmnsUx-]* : (?®ex) \) )(?<option_setting> \(\? [iJmnsUx-]* \) )(?<qualified_item> (?:\. | (?&lookaround) | (?&back_reference) | (?&character_class) | (?&character_type) | (?&escaped_character) | (?&group) | (?&subroutine_call) | (?&literal_character) | (?"ed_string) ) (?&comment)? (?&qualifier)? )(?<qualifier> (?: [?*+] | (?&range_qualifier) ) [+?]? )(?<quoted_string> (?: \\Q (?: (?!\\E | \k'delimiter') . )++ (?: \\E | ) ) ) (?<quoted_string_empty> \\Q\\E ) (?<range_qualifier> \{ (?: \d+ (?: , \d* )? | , \d+ ) \} )(?<regex> (?&start_item)* (?&branch) (?: \| (?&branch) )* )(?<resetting_group> \( \? \| (?®ex) \) )(?<simple_assertion> \^ | \$ | \\A | \\b | \\B | \\G | \\z | \\Z )(?<special_escape> \\K )(?<start_item> \( \* (?: ANY | ANYCRLF | BSR_ANYCRLF | BSR_UNICODE | CR | CRLF | LF | LIMIT_MATCH=\d+ | LIMIT_DEPTH=\d+ | LIMIT_HEAP=\d+ | NOTEMPTY | NOTEMPTY_ATSTART | NO_AUTO_POSSESS | NO_DOTSTAR_ANCHOR | NO_JIT | NO_START_OPT | NUL | UTF | UCP ) \) )(?<subroutine_call> (?: \(\?R\) | \(\?[+-]?\d+\) | \(\? (?: & | P> ) (?&groupname) \) | \\g < (?&groupname) > | \\g ' (?&groupname) ' | \\g < [+-]? \d+ > | \\g ' [+-]? \d+ ) )(?<verb> \(\* (?: ACCEPT | FAIL | F | COMMIT | (?:MARK)?:(?&verbname) | (?:PRUNE|SKIP|THEN) (?: : (?&verbname)? )? ) \) )(?<verbname> [^)]+ ))^(?&delimited_regex)$/
6126 /((?(?C'')\QX\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
6127 /(?:(?(2y)a|b)(X))+/
6130 /(?P<abn>(?P=abn)(?<badstufxxx)/
6132 # --------------------------------------------------------------------------
6149 /((?<=((*ACCEPT)) )\1?\b) /
6151 ((?<=((*ACCEPT)) )\\1?\\b)\x20
6153 /((?<=((*ACCEPT))X)\1?Y)\1/
6156 /((?<=((*ACCEPT))X)\1?Y(*ACCEPT))\1/
6159 /(?(DEFINE)(?<optional_a>a?)X)^(?&optional_a)a$/
6189 /(?<=\G.)/g,aftertext
6202 /a(?=.(*:X))(*SKIP:X)(*F)|(.)/
6205 /a(?>(*:X))(*SKIP:X)(*F)|(.)/
6208 /a(?:(*:X))(*SKIP:X)(*F)|(.)/
6211 #pattern no_start_optimize
6213 /(?>a(*:1))(?>b(*:1))(*SKIP:1)x|.*/
6216 /(?>a(*:1))(?>b)(*SKIP:1)x|.*/
6224 /(?=a(*ACCEPT:QQ)bc)axyz/
6227 /(?(DEFINE)(a(*ACCEPT:X)))(?1)b/
6233 /(?(DEFINE)(a(*F:X)))(?1)b/
6239 /(?(DEFINE)(a(*COMMIT:X)))(?1)b/
6242 /a+(*:Z)b(*COMMIT:X)(*SKIP:Z)c|.*/
6245 /a+(*:Z)b(*COMMIT:X)(*SKIP:X)c|.*/
6251 #pattern -no_start_optimize
6254 /(.COMMIT)(*COMMIT::::::::::interal error:::)/
6260 /(?i)A(?^)B(?^x:C D)(?^i)e f/