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

Contents of /code/trunk/testdata/testoutput7

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91 - (hide annotations) (download)
Sat Feb 24 21:41:34 2007 UTC (7 years, 9 months ago) by nigel
File size: 105921 byte(s)
Load pcre-6.7 into code/trunk.

1 nigel 77 /abc/
2     abc
3     0: abc
4    
5     /ab*c/
6     abc
7     0: abc
8     abbbbc
9     0: abbbbc
10     ac
11     0: ac
12    
13     /ab+c/
14     abc
15     0: abc
16     abbbbbbc
17     0: abbbbbbc
18     *** Failers
19     No match
20     ac
21     No match
22     ab
23     No match
24    
25     /a*/
26     a
27     0: a
28     1:
29     aaaaaaaaaaaaaaaaa
30     0: aaaaaaaaaaaaaaaaa
31     1: aaaaaaaaaaaaaaaa
32     2: aaaaaaaaaaaaaaa
33     3: aaaaaaaaaaaaaa
34     4: aaaaaaaaaaaaa
35     5: aaaaaaaaaaaa
36     6: aaaaaaaaaaa
37     7: aaaaaaaaaa
38     8: aaaaaaaaa
39     9: aaaaaaaa
40     10: aaaaaaa
41     11: aaaaaa
42     12: aaaaa
43     13: aaaa
44     14: aaa
45     15: aa
46     16: a
47     17:
48     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
49     Matched, but too many subsidiary matches
50     0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
51     1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
52     2: aaaaaaaaaaaaaaaaaaaaaaaaaaaa
53     3: aaaaaaaaaaaaaaaaaaaaaaaaaaa
54     4: aaaaaaaaaaaaaaaaaaaaaaaaaa
55     5: aaaaaaaaaaaaaaaaaaaaaaaaa
56     6: aaaaaaaaaaaaaaaaaaaaaaaa
57     7: aaaaaaaaaaaaaaaaaaaaaaa
58     8: aaaaaaaaaaaaaaaaaaaaaa
59     9: aaaaaaaaaaaaaaaaaaaaa
60     10: aaaaaaaaaaaaaaaaaaaa
61     11: aaaaaaaaaaaaaaaaaaa
62     12: aaaaaaaaaaaaaaaaaa
63     13: aaaaaaaaaaaaaaaaa
64     14: aaaaaaaaaaaaaaaa
65     15: aaaaaaaaaaaaaaa
66     16: aaaaaaaaaaaaaa
67     17: aaaaaaaaaaaaa
68     18: aaaaaaaaaaaa
69     19: aaaaaaaaaaa
70     20: aaaaaaaaaa
71     21: aaaaaaaaa
72     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F
73     0:
74    
75     /(a|abcd|african)/
76     a
77     0: a
78     abcd
79     0: abcd
80     1: a
81     african
82     0: african
83     1: a
84    
85     /^abc/
86     abcdef
87     0: abc
88     *** Failers
89     No match
90     xyzabc
91     No match
92     xyz\nabc
93     No match
94    
95     /^abc/m
96     abcdef
97     0: abc
98     xyz\nabc
99     0: abc
100     *** Failers
101     No match
102     xyzabc
103     No match
104    
105     /\Aabc/
106     abcdef
107     0: abc
108     *** Failers
109     No match
110     xyzabc
111     No match
112     xyz\nabc
113     No match
114    
115     /\Aabc/m
116     abcdef
117     0: abc
118     *** Failers
119     No match
120     xyzabc
121     No match
122     xyz\nabc
123     No match
124    
125     /\Gabc/
126     abcdef
127     0: abc
128     xyzabc\>3
129     0: abc
130     *** Failers
131     No match
132     xyzabc
133     No match
134     xyzabc\>2
135     No match
136    
137     /x\dy\Dz/
138     x9yzz
139     0: x9yzz
140     x0y+z
141     0: x0y+z
142     *** Failers
143     No match
144     xyz
145     No match
146     xxy0z
147     No match
148    
149     /x\sy\Sz/
150     x yzz
151     0: x yzz
152     x y+z
153     0: x y+z
154     *** Failers
155     No match
156     xyz
157     No match
158     xxyyz
159     No match
160    
161     /x\wy\Wz/
162     xxy+z
163     0: xxy+z
164     *** Failers
165     No match
166     xxy0z
167     No match
168     x+y+z
169     No match
170    
171     /x.y/
172     x+y
173     0: x+y
174     x-y
175     0: x-y
176     *** Failers
177     No match
178     x\ny
179     No match
180    
181     /x.y/s
182     x+y
183     0: x+y
184     x-y
185     0: x-y
186     x\ny
187     0: x\x0ay
188    
189     /(a.b(?s)c.d|x.y)p.q/
190     a+bc+dp+q
191     0: a+bc+dp+q
192     a+bc\ndp+q
193     0: a+bc\x0adp+q
194     x\nyp+q
195     0: x\x0ayp+q
196     *** Failers
197     No match
198     a\nbc\ndp+q
199     No match
200     a+bc\ndp\nq
201     No match
202     x\nyp\nq
203     No match
204    
205     /a\d\z/
206     ba0
207     0: a0
208     *** Failers
209     No match
210     ba0\n
211     No match
212     ba0\ncd
213     No match
214    
215     /a\d\z/m
216     ba0
217     0: a0
218     *** Failers
219     No match
220     ba0\n
221     No match
222     ba0\ncd
223     No match
224    
225     /a\d\Z/
226     ba0
227     0: a0
228     ba0\n
229     0: a0
230     *** Failers
231     No match
232     ba0\ncd
233     No match
234    
235     /a\d\Z/m
236     ba0
237     0: a0
238     ba0\n
239     0: a0
240     *** Failers
241     No match
242     ba0\ncd
243     No match
244    
245     /a\d$/
246     ba0
247     0: a0
248     ba0\n
249     0: a0
250     *** Failers
251     No match
252     ba0\ncd
253     No match
254    
255     /a\d$/m
256     ba0
257     0: a0
258     ba0\n
259     0: a0
260     ba0\ncd
261     0: a0
262     *** Failers
263     No match
264    
265     /abc/i
266     abc
267     0: abc
268     aBc
269     0: aBc
270     ABC
271     0: ABC
272    
273     /[^a]/
274     abcd
275     0: b
276    
277     /ab?\w/
278     abz
279     0: abz
280     1: ab
281     abbz
282     0: abb
283     1: ab
284     azz
285     0: az
286    
287     /x{0,3}yz/
288     ayzq
289     0: yz
290     axyzq
291     0: xyz
292     axxyz
293     0: xxyz
294     axxxyzq
295     0: xxxyz
296     axxxxyzq
297     0: xxxyz
298     *** Failers
299     No match
300     ax
301     No match
302     axx
303     No match
304    
305     /x{3}yz/
306     axxxyzq
307     0: xxxyz
308     axxxxyzq
309     0: xxxyz
310     *** Failers
311     No match
312     ax
313     No match
314     axx
315     No match
316     ayzq
317     No match
318     axyzq
319     No match
320     axxyz
321     No match
322    
323     /x{2,3}yz/
324     axxyz
325     0: xxyz
326     axxxyzq
327     0: xxxyz
328     axxxxyzq
329     0: xxxyz
330     *** Failers
331     No match
332     ax
333     No match
334     axx
335     No match
336     ayzq
337     No match
338     axyzq
339     No match
340    
341     /[^a]+/
342     bac
343     0: b
344     bcdefax
345     0: bcdef
346     1: bcde
347     2: bcd
348     3: bc
349     4: b
350     *** Failers
351     0: *** F
352     1: ***
353     2: ***
354     3: **
355     4: *
356     aaaaa
357     No match
358    
359     /[^a]*/
360     bac
361     0: b
362     1:
363     bcdefax
364     0: bcdef
365     1: bcde
366     2: bcd
367     3: bc
368     4: b
369     5:
370     *** Failers
371     0: *** F
372     1: ***
373     2: ***
374     3: **
375     4: *
376     5:
377     aaaaa
378     0:
379    
380     /[^a]{3,5}/
381     xyz
382     0: xyz
383     awxyza
384     0: wxyz
385     1: wxy
386     abcdefa
387     0: bcdef
388     1: bcde
389     2: bcd
390     abcdefghijk
391     0: bcdef
392     1: bcde
393     2: bcd
394     *** Failers
395     0: *** F
396     1: ***
397     2: ***
398     axya
399     No match
400     axa
401     No match
402     aaaaa
403     No match
404    
405     /\d*/
406     1234b567
407     0: 1234
408     1: 123
409     2: 12
410     3: 1
411     4:
412     xyz
413     0:
414    
415     /\D*/
416     a1234b567
417     0: a
418     1:
419     xyz
420     0: xyz
421     1: xy
422     2: x
423     3:
424    
425     /\d+/
426     ab1234c56
427     0: 1234
428     1: 123
429     2: 12
430     3: 1
431     *** Failers
432     No match
433     xyz
434     No match
435    
436     /\D+/
437     ab123c56
438     0: ab
439     1: a
440     *** Failers
441     0: *** Failers
442     1: *** Failer
443     2: *** Faile
444     3: *** Fail
445     4: *** Fai
446     5: *** Fa
447     6: *** F
448     7: ***
449     8: ***
450     9: **
451     10: *
452     789
453     No match
454    
455     /\d?A/
456     045ABC
457     0: 5A
458     ABC
459     0: A
460     *** Failers
461     No match
462     XYZ
463     No match
464    
465     /\D?A/
466     ABC
467     0: A
468     BAC
469     0: BA
470     9ABC
471     0: A
472     *** Failers
473     No match
474    
475     /a+/
476     aaaa
477     0: aaaa
478     1: aaa
479     2: aa
480     3: a
481    
482     /^.*xyz/
483     xyz
484     0: xyz
485     ggggggggxyz
486     0: ggggggggxyz
487    
488     /^.+xyz/
489     abcdxyz
490     0: abcdxyz
491     axyz
492     0: axyz
493     *** Failers
494     No match
495     xyz
496     No match
497    
498     /^.?xyz/
499     xyz
500     0: xyz
501     cxyz
502     0: cxyz
503    
504     /^\d{2,3}X/
505     12X
506     0: 12X
507     123X
508     0: 123X
509     *** Failers
510     No match
511     X
512     No match
513     1X
514     No match
515     1234X
516     No match
517    
518     /^[abcd]\d/
519     a45
520     0: a4
521     b93
522     0: b9
523     c99z
524     0: c9
525     d04
526     0: d0
527     *** Failers
528     No match
529     e45
530     No match
531     abcd
532     No match
533     abcd1234
534     No match
535     1234
536     No match
537    
538     /^[abcd]*\d/
539     a45
540     0: a4
541     b93
542     0: b9
543     c99z
544     0: c9
545     d04
546     0: d0
547     abcd1234
548     0: abcd1
549     1234
550     0: 1
551     *** Failers
552     No match
553     e45
554     No match
555     abcd
556     No match
557    
558     /^[abcd]+\d/
559     a45
560     0: a4
561     b93
562     0: b9
563     c99z
564     0: c9
565     d04
566     0: d0
567     abcd1234
568     0: abcd1
569     *** Failers
570     No match
571     1234
572     No match
573     e45
574     No match
575     abcd
576     No match
577    
578     /^a+X/
579     aX
580     0: aX
581     aaX
582     0: aaX
583    
584     /^[abcd]?\d/
585     a45
586     0: a4
587     b93
588     0: b9
589     c99z
590     0: c9
591     d04
592     0: d0
593     1234
594     0: 1
595     *** Failers
596     No match
597     abcd1234
598     No match
599     e45
600     No match
601    
602     /^[abcd]{2,3}\d/
603     ab45
604     0: ab4
605     bcd93
606     0: bcd9
607     *** Failers
608     No match
609     1234
610     No match
611     a36
612     No match
613     abcd1234
614     No match
615     ee45
616     No match
617    
618     /^(abc)*\d/
619     abc45
620     0: abc4
621     abcabcabc45
622     0: abcabcabc4
623     42xyz
624     0: 4
625     *** Failers
626     No match
627    
628     /^(abc)+\d/
629     abc45
630     0: abc4
631     abcabcabc45
632     0: abcabcabc4
633     *** Failers
634     No match
635     42xyz
636     No match
637    
638     /^(abc)?\d/
639     abc45
640     0: abc4
641     42xyz
642     0: 4
643     *** Failers
644     No match
645     abcabcabc45
646     No match
647    
648     /^(abc){2,3}\d/
649     abcabc45
650     0: abcabc4
651     abcabcabc45
652     0: abcabcabc4
653     *** Failers
654     No match
655     abcabcabcabc45
656     No match
657     abc45
658     No match
659     42xyz
660     No match
661    
662     /1(abc|xyz)2(?1)3/
663     1abc2abc3456
664     0: 1abc2abc3
665     1abc2xyz3456
666     0: 1abc2xyz3
667    
668     /^(a*\w|ab)=(a*\w|ab)/
669     ab=ab
670     0: ab=ab
671     1: ab=a
672    
673     /^(a*\w|ab)=(?1)/
674     ab=ab
675     0: ab=ab
676    
677     /^([^()]|\((?1)*\))*$/
678     abc
679     0: abc
680     a(b)c
681     0: a(b)c
682     a(b(c))d
683     0: a(b(c))d
684     *** Failers)
685     No match
686     a(b(c)d
687     No match
688    
689     /^>abc>([^()]|\((?1)*\))*<xyz<$/
690     >abc>123<xyz<
691     0: >abc>123<xyz<
692     >abc>1(2)3<xyz<
693     0: >abc>1(2)3<xyz<
694     >abc>(1(2)3)<xyz<
695     0: >abc>(1(2)3)<xyz<
696    
697     /^(?>a*)\d/
698     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876
699     0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9
700     *** Failers
701     No match
702     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
703     No match
704    
705     /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x
706     <>
707     0: <>
708     <abcd>
709     0: <abcd>
710     <abc <123> hij>
711     0: <abc <123> hij>
712     <abc <def> hij>
713     0: <def>
714     <abc<>def>
715     0: <abc<>def>
716     <abc<>
717     0: <>
718     *** Failers
719     No match
720     <abc
721     No match
722    
723     /^(?(?=abc)\w{3}:|\d\d)$/
724     abc:
725     0: abc:
726     12
727     0: 12
728     *** Failers
729     No match
730     123
731     No match
732     xyz
733     No match
734    
735     /^(?(?!abc)\d\d|\w{3}:)$/
736     abc:
737     0: abc:
738     12
739     0: 12
740     *** Failers
741     No match
742     123
743     No match
744     xyz
745     No match
746    
747     /^(?=abc)\w{5}:$/
748     abcde:
749     0: abcde:
750     *** Failers
751     No match
752     abc..
753     No match
754     123
755     No match
756     vwxyz
757     No match
758    
759     /^(?!abc)\d\d$/
760     12
761     0: 12
762     *** Failers
763     No match
764     abcde:
765     No match
766     abc..
767     No match
768     123
769     No match
770     vwxyz
771     No match
772    
773     /(?<=abc|xy)123/
774     abc12345
775     0: 123
776     wxy123z
777     0: 123
778     *** Failers
779     No match
780     123abc
781     No match
782    
783     /(?<!abc|xy)123/
784     123abc
785     0: 123
786     mno123456
787     0: 123
788     *** Failers
789     No match
790     abc12345
791     No match
792     wxy123z
793     No match
794    
795     /abc(?C1)xyz/
796     abcxyz
797     --->abcxyz
798     1 ^ ^ x
799     0: abcxyz
800     123abcxyz999
801     --->123abcxyz999
802     1 ^ ^ x
803     0: abcxyz
804    
805     /(ab|cd){3,4}/C
806     ababab
807     --->ababab
808     +0 ^ (ab|cd){3,4}
809     +1 ^ a
810     +4 ^ c
811     +2 ^^ b
812     +3 ^ ^ |
813     +1 ^ ^ a
814     +4 ^ ^ c
815     +2 ^ ^ b
816     +3 ^ ^ |
817     +1 ^ ^ a
818     +4 ^ ^ c
819     +2 ^ ^ b
820     +3 ^ ^ |
821     +12 ^ ^
822     +1 ^ ^ a
823     +4 ^ ^ c
824     0: ababab
825     abcdabcd
826     --->abcdabcd
827     +0 ^ (ab|cd){3,4}
828     +1 ^ a
829     +4 ^ c
830     +2 ^^ b
831     +3 ^ ^ |
832     +1 ^ ^ a
833     +4 ^ ^ c
834     +5 ^ ^ d
835     +6 ^ ^ )
836     +1 ^ ^ a
837     +4 ^ ^ c
838     +2 ^ ^ b
839     +3 ^ ^ |
840     +12 ^ ^
841     +1 ^ ^ a
842     +4 ^ ^ c
843     +5 ^ ^ d
844     +6 ^ ^ )
845     +12 ^ ^
846     0: abcdabcd
847     1: abcdab
848     abcdcdcdcdcd
849     --->abcdcdcdcdcd
850     +0 ^ (ab|cd){3,4}
851     +1 ^ a
852     +4 ^ c
853     +2 ^^ b
854     +3 ^ ^ |
855     +1 ^ ^ a
856     +4 ^ ^ c
857     +5 ^ ^ d
858     +6 ^ ^ )
859     +1 ^ ^ a
860     +4 ^ ^ c
861     +5 ^ ^ d
862     +6 ^ ^ )
863     +12 ^ ^
864     +1 ^ ^ a
865     +4 ^ ^ c
866     +5 ^ ^ d
867     +6 ^ ^ )
868     +12 ^ ^
869     0: abcdcdcd
870     1: abcdcd
871    
872     /^abc/
873     abcdef
874     0: abc
875     *** Failers
876     No match
877     abcdef\B
878     No match
879    
880     /^(a*|xyz)/
881     bcd
882     0:
883     aaabcd
884     0: aaa
885     1: aa
886     2: a
887     3:
888     xyz
889     0: xyz
890     1:
891     xyz\N
892     0: xyz
893     *** Failers
894     0:
895     bcd\N
896     No match
897    
898     /xyz$/
899     xyz
900     0: xyz
901     xyz\n
902     0: xyz
903     *** Failers
904     No match
905     xyz\Z
906     No match
907     xyz\n\Z
908     No match
909    
910     /xyz$/m
911     xyz
912     0: xyz
913     xyz\n
914     0: xyz
915     abcxyz\npqr
916     0: xyz
917     abcxyz\npqr\Z
918     0: xyz
919     xyz\n\Z
920     0: xyz
921     *** Failers
922     No match
923     xyz\Z
924     No match
925    
926     /\Gabc/
927     abcdef
928     0: abc
929     defabcxyz\>3
930     0: abc
931     *** Failers
932     No match
933     defabcxyz
934     No match
935    
936     /^abcdef/
937     ab\P
938     Partial match: ab
939     abcde\P
940     Partial match: abcde
941     abcdef\P
942     0: abcdef
943     *** Failers
944     No match
945     abx\P
946     No match
947    
948     /^a{2,4}\d+z/
949     a\P
950     Partial match: a
951     aa\P
952     Partial match: aa
953     aa2\P
954     Partial match: aa2
955     aaa\P
956     Partial match: aaa
957     aaa23\P
958     Partial match: aaa23
959     aaaa12345\P
960     Partial match: aaaa12345
961     aa0z\P
962     0: aa0z
963     aaaa4444444444444z\P
964     0: aaaa4444444444444z
965     *** Failers
966     No match
967     az\P
968     No match
969     aaaaa\P
970     No match
971     a56\P
972     No match
973    
974     /^abcdef/
975     abc\P
976     Partial match: abc
977     def\R
978     0: def
979    
980     /(?<=foo)bar/
981     xyzfo\P
982     No match
983 nigel 87 foob\P\>2
984 nigel 77 Partial match: b
985     foobar...\R\P\>4
986     0: ar
987     xyzfo\P
988     No match
989 nigel 87 foobar\>2
990 nigel 77 0: bar
991     *** Failers
992     No match
993     xyzfo\P
994     No match
995     obar\R
996     No match
997    
998     /(ab*(cd|ef))+X/
999     adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z
1000     No match
1001     lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z
1002     Partial match: abbbbbbcdaefabbbbbbbefa
1003     cdabbbbbbbb\P\R\B\Z
1004     Partial match: cdabbbbbbbb
1005     efabbbbbbbbbbbbbbbb\P\R\B\Z
1006     Partial match: efabbbbbbbbbbbbbbbb
1007     bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z
1008     0: bbbbbbbbbbbbcdX
1009    
1010     /(a|b)/SF>testsavedregex
1011     Compiled regex written to testsavedregex
1012     Study data written to testsavedregex
1013     <testsavedregex
1014     Compiled regex (byte-inverted) loaded from testsavedregex
1015     Study data loaded from testsavedregex
1016     abc
1017     0: a
1018     ** Failers
1019     0: a
1020     def
1021     No match
1022    
1023     /the quick brown fox/
1024     the quick brown fox
1025     0: the quick brown fox
1026     The quick brown FOX
1027     No match
1028     What do you know about the quick brown fox?
1029     0: the quick brown fox
1030     What do you know about THE QUICK BROWN FOX?
1031     No match
1032    
1033     /The quick brown fox/i
1034     the quick brown fox
1035     0: the quick brown fox
1036     The quick brown FOX
1037     0: The quick brown FOX
1038     What do you know about the quick brown fox?
1039     0: the quick brown fox
1040     What do you know about THE QUICK BROWN FOX?
1041     0: THE QUICK BROWN FOX
1042    
1043     /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
1044     abcd\t\n\r\f\a\e9;\$\\?caxyz
1045     0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz
1046    
1047     /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
1048     abxyzpqrrrabbxyyyypqAzz
1049     0: abxyzpqrrrabbxyyyypqAzz
1050     abxyzpqrrrabbxyyyypqAzz
1051     0: abxyzpqrrrabbxyyyypqAzz
1052     aabxyzpqrrrabbxyyyypqAzz
1053     0: aabxyzpqrrrabbxyyyypqAzz
1054     aaabxyzpqrrrabbxyyyypqAzz
1055     0: aaabxyzpqrrrabbxyyyypqAzz
1056     aaaabxyzpqrrrabbxyyyypqAzz
1057     0: aaaabxyzpqrrrabbxyyyypqAzz
1058     abcxyzpqrrrabbxyyyypqAzz
1059     0: abcxyzpqrrrabbxyyyypqAzz
1060     aabcxyzpqrrrabbxyyyypqAzz
1061     0: aabcxyzpqrrrabbxyyyypqAzz
1062     aaabcxyzpqrrrabbxyyyypAzz
1063     0: aaabcxyzpqrrrabbxyyyypAzz
1064     aaabcxyzpqrrrabbxyyyypqAzz
1065     0: aaabcxyzpqrrrabbxyyyypqAzz
1066     aaabcxyzpqrrrabbxyyyypqqAzz
1067     0: aaabcxyzpqrrrabbxyyyypqqAzz
1068     aaabcxyzpqrrrabbxyyyypqqqAzz
1069     0: aaabcxyzpqrrrabbxyyyypqqqAzz
1070     aaabcxyzpqrrrabbxyyyypqqqqAzz
1071     0: aaabcxyzpqrrrabbxyyyypqqqqAzz
1072     aaabcxyzpqrrrabbxyyyypqqqqqAzz
1073     0: aaabcxyzpqrrrabbxyyyypqqqqqAzz
1074     aaabcxyzpqrrrabbxyyyypqqqqqqAzz
1075     0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz
1076     aaaabcxyzpqrrrabbxyyyypqAzz
1077     0: aaaabcxyzpqrrrabbxyyyypqAzz
1078     abxyzzpqrrrabbxyyyypqAzz
1079     0: abxyzzpqrrrabbxyyyypqAzz
1080     aabxyzzzpqrrrabbxyyyypqAzz
1081     0: aabxyzzzpqrrrabbxyyyypqAzz
1082     aaabxyzzzzpqrrrabbxyyyypqAzz
1083     0: aaabxyzzzzpqrrrabbxyyyypqAzz
1084     aaaabxyzzzzpqrrrabbxyyyypqAzz
1085     0: aaaabxyzzzzpqrrrabbxyyyypqAzz
1086     abcxyzzpqrrrabbxyyyypqAzz
1087     0: abcxyzzpqrrrabbxyyyypqAzz
1088     aabcxyzzzpqrrrabbxyyyypqAzz
1089     0: aabcxyzzzpqrrrabbxyyyypqAzz
1090     aaabcxyzzzzpqrrrabbxyyyypqAzz
1091     0: aaabcxyzzzzpqrrrabbxyyyypqAzz
1092     aaaabcxyzzzzpqrrrabbxyyyypqAzz
1093     0: aaaabcxyzzzzpqrrrabbxyyyypqAzz
1094     aaaabcxyzzzzpqrrrabbbxyyyypqAzz
1095     0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz
1096     aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
1097     0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
1098     aaabcxyzpqrrrabbxyyyypABzz
1099     0: aaabcxyzpqrrrabbxyyyypABzz
1100     aaabcxyzpqrrrabbxyyyypABBzz
1101     0: aaabcxyzpqrrrabbxyyyypABBzz
1102     >>>aaabxyzpqrrrabbxyyyypqAzz
1103     0: aaabxyzpqrrrabbxyyyypqAzz
1104     >aaaabxyzpqrrrabbxyyyypqAzz
1105     0: aaaabxyzpqrrrabbxyyyypqAzz
1106     >>>>abcxyzpqrrrabbxyyyypqAzz
1107     0: abcxyzpqrrrabbxyyyypqAzz
1108     *** Failers
1109     No match
1110     abxyzpqrrabbxyyyypqAzz
1111     No match
1112     abxyzpqrrrrabbxyyyypqAzz
1113     No match
1114     abxyzpqrrrabxyyyypqAzz
1115     No match
1116     aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
1117     No match
1118     aaaabcxyzzzzpqrrrabbbxyyypqAzz
1119     No match
1120     aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
1121     No match
1122    
1123     /^(abc){1,2}zz/
1124     abczz
1125     0: abczz
1126     abcabczz
1127     0: abcabczz
1128     *** Failers
1129     No match
1130     zz
1131     No match
1132     abcabcabczz
1133     No match
1134     >>abczz
1135     No match
1136    
1137     /^(b+?|a){1,2}?c/
1138     bc
1139     0: bc
1140     bbc
1141     0: bbc
1142     bbbc
1143     0: bbbc
1144     bac
1145     0: bac
1146     bbac
1147     0: bbac
1148     aac
1149     0: aac
1150     abbbbbbbbbbbc
1151     0: abbbbbbbbbbbc
1152     bbbbbbbbbbbac
1153     0: bbbbbbbbbbbac
1154     *** Failers
1155     No match
1156     aaac
1157     No match
1158     abbbbbbbbbbbac
1159     No match
1160    
1161     /^(b+|a){1,2}c/
1162     bc
1163     0: bc
1164     bbc
1165     0: bbc
1166     bbbc
1167     0: bbbc
1168     bac
1169     0: bac
1170     bbac
1171     0: bbac
1172     aac
1173     0: aac
1174     abbbbbbbbbbbc
1175     0: abbbbbbbbbbbc
1176     bbbbbbbbbbbac
1177     0: bbbbbbbbbbbac
1178     *** Failers
1179     No match
1180     aaac
1181     No match
1182     abbbbbbbbbbbac
1183     No match
1184    
1185     /^(b+|a){1,2}?bc/
1186     bbc
1187     0: bbc
1188    
1189     /^(b*|ba){1,2}?bc/
1190     babc
1191     0: babc
1192     bbabc
1193     0: bbabc
1194     bababc
1195     0: bababc
1196     *** Failers
1197     No match
1198     bababbc
1199     No match
1200     babababc
1201     No match
1202    
1203     /^(ba|b*){1,2}?bc/
1204     babc
1205     0: babc
1206     bbabc
1207     0: bbabc
1208     bababc
1209     0: bababc
1210     *** Failers
1211     No match
1212     bababbc
1213     No match
1214     babababc
1215     No match
1216    
1217     /^\ca\cA\c[\c{\c:/
1218     \x01\x01\e;z
1219     0: \x01\x01\x1b;z
1220    
1221     /^[ab\]cde]/
1222     athing
1223     0: a
1224     bthing
1225     0: b
1226     ]thing
1227     0: ]
1228     cthing
1229     0: c
1230     dthing
1231     0: d
1232     ething
1233     0: e
1234     *** Failers
1235     No match
1236     fthing
1237     No match
1238     [thing
1239     No match
1240     \\thing
1241     No match
1242    
1243     /^[]cde]/
1244     ]thing
1245     0: ]
1246     cthing
1247     0: c
1248     dthing
1249     0: d
1250     ething
1251     0: e
1252     *** Failers
1253     No match
1254     athing
1255     No match
1256     fthing
1257     No match
1258    
1259     /^[^ab\]cde]/
1260     fthing
1261     0: f
1262     [thing
1263     0: [
1264     \\thing
1265     0: \
1266     *** Failers
1267     0: *
1268     athing
1269     No match
1270     bthing
1271     No match
1272     ]thing
1273     No match
1274     cthing
1275     No match
1276     dthing
1277     No match
1278     ething
1279     No match
1280    
1281     /^[^]cde]/
1282     athing
1283     0: a
1284     fthing
1285     0: f
1286     *** Failers
1287     0: *
1288     ]thing
1289     No match
1290     cthing
1291     No match
1292     dthing
1293     No match
1294     ething
1295     No match
1296    
1297     /^\/
1298    
1299     0: \x81
1300    
1301     /^/
1302    
1303     0: \xff
1304    
1305     /^[0-9]+$/
1306     0
1307     0: 0
1308     1
1309     0: 1
1310     2
1311     0: 2
1312     3
1313     0: 3
1314     4
1315     0: 4
1316     5
1317     0: 5
1318     6
1319     0: 6
1320     7
1321     0: 7
1322     8
1323     0: 8
1324     9
1325     0: 9
1326     10
1327     0: 10
1328     100
1329     0: 100
1330     *** Failers
1331     No match
1332     abc
1333     No match
1334    
1335     /^.*nter/
1336     enter
1337     0: enter
1338     inter
1339     0: inter
1340     uponter
1341     0: uponter
1342    
1343     /^xxx[0-9]+$/
1344     xxx0
1345     0: xxx0
1346     xxx1234
1347     0: xxx1234
1348     *** Failers
1349     No match
1350     xxx
1351     No match
1352    
1353     /^.+[0-9][0-9][0-9]$/
1354     x123
1355     0: x123
1356     xx123
1357     0: xx123
1358     123456
1359     0: 123456
1360     *** Failers
1361     No match
1362     123
1363     No match
1364     x1234
1365     0: x1234
1366    
1367     /^.+?[0-9][0-9][0-9]$/
1368     x123
1369     0: x123
1370     xx123
1371     0: xx123
1372     123456
1373     0: 123456
1374     *** Failers
1375     No match
1376     123
1377     No match
1378     x1234
1379     0: x1234
1380    
1381     /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
1382     abc!pqr=apquxz.ixr.zzz.ac.uk
1383     0: abc!pqr=apquxz.ixr.zzz.ac.uk
1384     *** Failers
1385     No match
1386     !pqr=apquxz.ixr.zzz.ac.uk
1387     No match
1388     abc!=apquxz.ixr.zzz.ac.uk
1389     No match
1390     abc!pqr=apquxz:ixr.zzz.ac.uk
1391     No match
1392     abc!pqr=apquxz.ixr.zzz.ac.ukk
1393     No match
1394    
1395     /:/
1396     Well, we need a colon: somewhere
1397     0: :
1398     *** Fail if we don't
1399     No match
1400    
1401     /([\da-f:]+)$/i
1402     0abc
1403     0: 0abc
1404     abc
1405     0: abc
1406     fed
1407     0: fed
1408     E
1409     0: E
1410     ::
1411     0: ::
1412     5f03:12C0::932e
1413     0: 5f03:12C0::932e
1414     fed def
1415     0: def
1416     Any old stuff
1417     0: ff
1418     *** Failers
1419     No match
1420     0zzz
1421     No match
1422     gzzz
1423     No match
1424     fed\x20
1425     No match
1426     Any old rubbish
1427     No match
1428    
1429     /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
1430     .1.2.3
1431     0: .1.2.3
1432     A.12.123.0
1433     0: A.12.123.0
1434     *** Failers
1435     No match
1436     .1.2.3333
1437     No match
1438     1.2.3
1439     No match
1440     1234.2.3
1441     No match
1442    
1443     /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
1444     1 IN SOA non-sp1 non-sp2(
1445     0: 1 IN SOA non-sp1 non-sp2(
1446     1 IN SOA non-sp1 non-sp2 (
1447     0: 1 IN SOA non-sp1 non-sp2 (
1448     *** Failers
1449     No match
1450     1IN SOA non-sp1 non-sp2(
1451     No match
1452    
1453     /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
1454     a.
1455     0: a.
1456     Z.
1457     0: Z.
1458     2.
1459     0: 2.
1460     ab-c.pq-r.
1461     0: ab-c.pq-r.
1462     sxk.zzz.ac.uk.
1463     0: sxk.zzz.ac.uk.
1464     x-.y-.
1465     0: x-.y-.
1466     *** Failers
1467     No match
1468     -abc.peq.
1469     No match
1470    
1471     /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
1472     *.a
1473     0: *.a
1474     *.b0-a
1475     0: *.b0-a
1476     *.c3-b.c
1477     0: *.c3-b.c
1478     *.c-a.b-c
1479     0: *.c-a.b-c
1480     *** Failers
1481     No match
1482     *.0
1483     No match
1484     *.a-
1485     No match
1486     *.a-b.c-
1487     No match
1488     *.c-a.0-c
1489     No match
1490    
1491     /^(?=ab(de))(abd)(e)/
1492     abde
1493     0: abde
1494    
1495     /^(?!(ab)de|x)(abd)(f)/
1496     abdf
1497     0: abdf
1498    
1499     /^(?=(ab(cd)))(ab)/
1500     abcd
1501     0: ab
1502    
1503     /^[\da-f](\.[\da-f])*$/i
1504     a.b.c.d
1505     0: a.b.c.d
1506     A.B.C.D
1507     0: A.B.C.D
1508     a.b.c.1.2.3.C
1509     0: a.b.c.1.2.3.C
1510    
1511     /^\".*\"\s*(;.*)?$/
1512     \"1234\"
1513     0: "1234"
1514     \"abcd\" ;
1515     0: "abcd" ;
1516     \"\" ; rhubarb
1517     0: "" ; rhubarb
1518     *** Failers
1519     No match
1520     \"1234\" : things
1521     No match
1522    
1523     /^$/
1524     \
1525     0:
1526     *** Failers
1527     No match
1528    
1529     / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
1530     ab c
1531     0: ab c
1532     *** Failers
1533     No match
1534     abc
1535     No match
1536     ab cde
1537     No match
1538    
1539     /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
1540     ab c
1541     0: ab c
1542     *** Failers
1543     No match
1544     abc
1545     No match
1546     ab cde
1547     No match
1548    
1549     /^ a\ b[c ]d $/x
1550     a bcd
1551     0: a bcd
1552     a b d
1553     0: a b d
1554     *** Failers
1555     No match
1556     abcd
1557     No match
1558     ab d
1559     No match
1560    
1561     /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
1562     abcdefhijklm
1563     0: abcdefhijklm
1564    
1565     /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
1566     abcdefhijklm
1567     0: abcdefhijklm
1568    
1569     /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
1570     a+ Z0+\x08\n\x1d\x12
1571     0: a+ Z0+\x08\x0a\x1d\x12
1572    
1573     /^[.^$|()*+?{,}]+/
1574     .^\$(*+)|{?,?}
1575     0: .^$(*+)|{?,?}
1576     1: .^$(*+)|{?,?
1577     2: .^$(*+)|{?,
1578     3: .^$(*+)|{?
1579     4: .^$(*+)|{
1580     5: .^$(*+)|
1581     6: .^$(*+)
1582     7: .^$(*+
1583     8: .^$(*
1584     9: .^$(
1585     10: .^$
1586     11: .^
1587     12: .
1588    
1589     /^a*\w/
1590     z
1591     0: z
1592     az
1593     0: az
1594     1: a
1595     aaaz
1596     0: aaaz
1597     1: aaa
1598     2: aa
1599     3: a
1600     a
1601     0: a
1602     aa
1603     0: aa
1604     1: a
1605     aaaa
1606     0: aaaa
1607     1: aaa
1608     2: aa
1609     3: a
1610     a+
1611     0: a
1612     aa+
1613     0: aa
1614     1: a
1615    
1616     /^a*?\w/
1617     z
1618     0: z
1619     az
1620     0: az
1621     1: a
1622     aaaz
1623     0: aaaz
1624     1: aaa
1625     2: aa
1626     3: a
1627     a
1628     0: a
1629     aa
1630     0: aa
1631     1: a
1632     aaaa
1633     0: aaaa
1634     1: aaa
1635     2: aa
1636     3: a
1637     a+
1638     0: a
1639     aa+
1640     0: aa
1641     1: a
1642    
1643     /^a+\w/
1644     az
1645     0: az
1646     aaaz
1647     0: aaaz
1648     1: aaa
1649     2: aa
1650     aa
1651     0: aa
1652     aaaa
1653     0: aaaa
1654     1: aaa
1655     2: aa
1656     aa+
1657     0: aa
1658    
1659     /^a+?\w/
1660     az
1661     0: az
1662     aaaz
1663     0: aaaz
1664     1: aaa
1665     2: aa
1666     aa
1667     0: aa
1668     aaaa
1669     0: aaaa
1670     1: aaa
1671     2: aa
1672     aa+
1673     0: aa
1674    
1675     /^\d{8}\w{2,}/
1676     1234567890
1677     0: 1234567890
1678     12345678ab
1679     0: 12345678ab
1680     12345678__
1681     0: 12345678__
1682     *** Failers
1683     No match
1684     1234567
1685     No match
1686    
1687     /^[aeiou\d]{4,5}$/
1688     uoie
1689     0: uoie
1690     1234
1691     0: 1234
1692     12345
1693     0: 12345
1694     aaaaa
1695     0: aaaaa
1696     *** Failers
1697     No match
1698     123456
1699     No match
1700    
1701     /^[aeiou\d]{4,5}?/
1702     uoie
1703     0: uoie
1704     1234
1705     0: 1234
1706     12345
1707     0: 12345
1708     1: 1234
1709     aaaaa
1710     0: aaaaa
1711     1: aaaa
1712     123456
1713     0: 12345
1714     1: 1234
1715    
1716     /^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]/
1717     From abcd Mon Sep 01 12:33:02 1997
1718     0: From abcd Mon Sep 01 12:33
1719    
1720     /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
1721     From abcd Mon Sep 01 12:33:02 1997
1722     0: From abcd Mon Sep 01 12:33
1723     From abcd Mon Sep 1 12:33:02 1997
1724     0: From abcd Mon Sep 1 12:33
1725     *** Failers
1726     No match
1727     From abcd Sep 01 12:33:02 1997
1728     No match
1729    
1730     /^12.34/s
1731     12\n34
1732     0: 12\x0a34
1733     12\r34
1734     0: 12\x0d34
1735    
1736     /\w+(?=\t)/
1737     the quick brown\t fox
1738     0: brown
1739    
1740     /foo(?!bar)(.*)/
1741     foobar is foolish see?
1742     0: foolish see?
1743     1: foolish see
1744     2: foolish se
1745     3: foolish s
1746     4: foolish
1747     5: foolish
1748     6: foolis
1749     7: fooli
1750     8: fool
1751     9: foo
1752    
1753     /(?:(?!foo)...|^.{0,2})bar(.*)/
1754     foobar crowbar etc
1755     0: rowbar etc
1756     1: rowbar et
1757     2: rowbar e
1758     3: rowbar
1759     4: rowbar
1760     barrel
1761     0: barrel
1762     1: barre
1763     2: barr
1764     3: bar
1765     2barrel
1766     0: 2barrel
1767     1: 2barre
1768     2: 2barr
1769     3: 2bar
1770     A barrel
1771     0: A barrel
1772     1: A barre
1773     2: A barr
1774     3: A bar
1775    
1776     /^(\D*)(?=\d)(?!123)/
1777     abc456
1778     0: abc
1779     *** Failers
1780     No match
1781     abc123
1782     No match
1783    
1784     /^1234(?# test newlines
1785     inside)/
1786     1234
1787     0: 1234
1788    
1789     /^1234 #comment in extended re
1790     /x
1791     1234
1792     0: 1234
1793    
1794     /#rhubarb
1795     abcd/x
1796     abcd
1797     0: abcd
1798    
1799     /^abcd#rhubarb/x
1800     abcd
1801     0: abcd
1802    
1803     /(?!^)abc/
1804     the abc
1805     0: abc
1806     *** Failers
1807     No match
1808     abc
1809     No match
1810    
1811     /(?=^)abc/
1812     abc
1813     0: abc
1814     *** Failers
1815     No match
1816     the abc
1817     No match
1818    
1819     /^[ab]{1,3}(ab*|b)/
1820     aabbbbb
1821     0: aabbbbb
1822     1: aabbbb
1823     2: aabbb
1824     3: aabb
1825     4: aab
1826     5: aa
1827    
1828     /^[ab]{1,3}?(ab*|b)/
1829     aabbbbb
1830     0: aabbbbb
1831     1: aabbbb
1832     2: aabbb
1833     3: aabb
1834     4: aab
1835     5: aa
1836    
1837     /^[ab]{1,3}?(ab*?|b)/
1838     aabbbbb
1839     0: aabbbbb
1840     1: aabbbb
1841     2: aabbb
1842     3: aabb
1843     4: aab
1844     5: aa
1845    
1846     /^[ab]{1,3}(ab*?|b)/
1847     aabbbbb
1848     0: aabbbbb
1849     1: aabbbb
1850     2: aabbb
1851     3: aabb
1852     4: aab
1853     5: aa
1854    
1855     / (?: [\040\t] | \(
1856     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1857     \) )* # optional leading comment
1858     (?: (?:
1859     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1860     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1861     |
1862     " (?: # opening quote...
1863     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
1864     | # or
1865     \\ [^\x80-\xff] # Escaped something (something != CR)
1866     )* " # closing quote
1867     ) # initial word
1868     (?: (?: [\040\t] | \(
1869     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1870     \) )* \. (?: [\040\t] | \(
1871     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1872     \) )* (?:
1873     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1874     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1875     |
1876     " (?: # opening quote...
1877     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
1878     | # or
1879     \\ [^\x80-\xff] # Escaped something (something != CR)
1880     )* " # closing quote
1881     ) )* # further okay, if led by a period
1882     (?: [\040\t] | \(
1883     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1884     \) )* @ (?: [\040\t] | \(
1885     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1886     \) )* (?:
1887     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1888     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1889     | \[ # [
1890     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1891     \] # ]
1892     ) # initial subdomain
1893     (?: #
1894     (?: [\040\t] | \(
1895     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1896     \) )* \. # if led by a period...
1897     (?: [\040\t] | \(
1898     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1899     \) )* (?:
1900     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1901     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1902     | \[ # [
1903     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1904     \] # ]
1905     ) # ...further okay
1906     )*
1907     # address
1908     | # or
1909     (?:
1910     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1911     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1912     |
1913     " (?: # opening quote...
1914     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
1915     | # or
1916     \\ [^\x80-\xff] # Escaped something (something != CR)
1917     )* " # closing quote
1918     ) # one word, optionally followed by....
1919     (?:
1920     [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
1921     \(
1922     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1923     \) | # comments, or...
1924    
1925     " (?: # opening quote...
1926     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
1927     | # or
1928     \\ [^\x80-\xff] # Escaped something (something != CR)
1929     )* " # closing quote
1930     # quoted strings
1931     )*
1932     < (?: [\040\t] | \(
1933     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1934     \) )* # leading <
1935     (?: @ (?: [\040\t] | \(
1936     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1937     \) )* (?:
1938     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1939     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1940     | \[ # [
1941     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1942     \] # ]
1943     ) # initial subdomain
1944     (?: #
1945     (?: [\040\t] | \(
1946     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1947     \) )* \. # if led by a period...
1948     (?: [\040\t] | \(
1949     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1950     \) )* (?:
1951     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1952     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1953     | \[ # [
1954     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1955     \] # ]
1956     ) # ...further okay
1957     )*
1958    
1959     (?: (?: [\040\t] | \(
1960     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1961     \) )* , (?: [\040\t] | \(
1962     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1963     \) )* @ (?: [\040\t] | \(
1964     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1965     \) )* (?:
1966     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1967     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1968     | \[ # [
1969     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1970     \] # ]
1971     ) # initial subdomain
1972     (?: #
1973     (?: [\040\t] | \(
1974     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1975     \) )* \. # if led by a period...
1976     (?: [\040\t] | \(
1977     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1978     \) )* (?:
1979     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1980     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1981     | \[ # [
1982     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1983     \] # ]
1984     ) # ...further okay
1985     )*
1986     )* # further okay, if led by comma
1987     : # closing colon
1988     (?: [\040\t] | \(
1989     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
1990     \) )* )? # optional route
1991     (?:
1992     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1993     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1994     |
1995     " (?: # opening quote...
1996     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
1997     | # or
1998     \\ [^\x80-\xff] # Escaped something (something != CR)
1999     )* " # closing quote
2000     ) # initial word
2001     (?: (?: [\040\t] | \(
2002     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2003     \) )* \. (?: [\040\t] | \(
2004     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2005     \) )* (?:
2006     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2007     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2008     |
2009     " (?: # opening quote...
2010     [^\\\x80-\xff\n\015"] # Anything except backslash and quote
2011     | # or
2012     \\ [^\x80-\xff] # Escaped something (something != CR)
2013     )* " # closing quote
2014     ) )* # further okay, if led by a period
2015     (?: [\040\t] | \(
2016     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2017     \) )* @ (?: [\040\t] | \(
2018     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2019     \) )* (?:
2020     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2021     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2022     | \[ # [
2023     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2024     \] # ]
2025     ) # initial subdomain
2026     (?: #
2027     (?: [\040\t] | \(
2028     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2029     \) )* \. # if led by a period...
2030     (?: [\040\t] | \(
2031     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2032     \) )* (?:
2033     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2034     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2035     | \[ # [
2036     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2037     \] # ]
2038     ) # ...further okay
2039     )*
2040     # address spec
2041     (?: [\040\t] | \(
2042     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2043     \) )* > # trailing >
2044     # name and address
2045     ) (?: [\040\t] | \(
2046     (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
2047     \) )* # optional trailing comment
2048     /x
2049     Alan Other <user\@dom.ain>
2050     0: Alan Other <user@dom.ain>
2051     <user\@dom.ain>
2052     0: user@dom.ain
2053     1: user@dom
2054     user\@dom.ain
2055     0: user@dom.ain
2056     1: user@dom
2057     \"A. Other\" <user.1234\@dom.ain> (a comment)
2058     0: "A. Other" <user.1234@dom.ain> (a comment)
2059     1: "A. Other" <user.1234@dom.ain>
2060     2: "A. Other" <user.1234@dom.ain>
2061     A. Other <user.1234\@dom.ain> (a comment)
2062     0: Other <user.1234@dom.ain> (a comment)
2063     1: Other <user.1234@dom.ain>
2064     2: Other <user.1234@dom.ain>
2065     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
2066     0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay
2067     1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re
2068     A missing angle <user\@some.where
2069     0: user@some.where
2070     1: user@some
2071     *** Failers
2072     No match
2073     The quick brown fox
2074     No match
2075    
2076     /[\040\t]* # Nab whitespace.
2077     (?:
2078     \( # (
2079     [^\\\x80-\xff\n\015()] * # normal*
2080     (?: # (
2081     (?: \\ [^\x80-\xff] |
2082     \( # (
2083     [^\\\x80-\xff\n\015()] * # normal*
2084     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2085     \) # )
2086     ) # special
2087     [^\\\x80-\xff\n\015()] * # normal*
2088     )* # )*
2089     \) # )
2090     [\040\t]* )* # If comment found, allow more spaces.
2091     # optional leading comment
2092     (?:
2093     (?:
2094     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2095     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2096     # Atom
2097     | # or
2098     " # "
2099     [^\\\x80-\xff\n\015"] * # normal
2100     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
2101     " # "
2102     # Quoted string
2103     )
2104     [\040\t]* # Nab whitespace.
2105     (?:
2106     \( # (
2107     [^\\\x80-\xff\n\015()] * # normal*
2108     (?: # (
2109     (?: \\ [^\x80-\xff] |
2110     \( # (
2111     [^\\\x80-\xff\n\015()] * # normal*
2112     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2113     \) # )
2114     ) # special
2115     [^\\\x80-\xff\n\015()] * # normal*
2116     )* # )*
2117     \) # )
2118     [\040\t]* )* # If comment found, allow more spaces.
2119     (?:
2120     \.
2121     [\040\t]* # Nab whitespace.
2122     (?:
2123     \( # (
2124     [^\\\x80-\xff\n\015()] * # normal*
2125     (?: # (
2126     (?: \\ [^\x80-\xff] |
2127     \( # (
2128     [^\\\x80-\xff\n\015()] * # normal*
2129     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2130     \) # )
2131     ) # special
2132     [^\\\x80-\xff\n\015()] * # normal*
2133     )* # )*
2134     \) # )
2135     [\040\t]* )* # If comment found, allow more spaces.
2136     (?:
2137     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2138     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2139     # Atom
2140     | # or
2141     " # "
2142     [^\\\x80-\xff\n\015"] * # normal
2143     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
2144     " # "
2145     # Quoted string
2146     )
2147     [\040\t]* # Nab whitespace.
2148     (?:
2149     \( # (
2150     [^\\\x80-\xff\n\015()] * # normal*
2151     (?: # (
2152     (?: \\ [^\x80-\xff] |
2153     \( # (
2154     [^\\\x80-\xff\n\015()] * # normal*
2155     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2156     \) # )
2157     ) # special
2158     [^\\\x80-\xff\n\015()] * # normal*
2159     )* # )*
2160     \) # )
2161     [\040\t]* )* # If comment found, allow more spaces.
2162     # additional words
2163     )*
2164     @
2165     [\040\t]* # Nab whitespace.
2166     (?:
2167     \( # (
2168     [^\\\x80-\xff\n\015()] * # normal*
2169     (?: # (
2170     (?: \\ [^\x80-\xff] |
2171     \( # (
2172     [^\\\x80-\xff\n\015()] * # normal*
2173     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2174     \) # )
2175     ) # special
2176     [^\\\x80-\xff\n\015()] * # normal*
2177     )* # )*
2178     \) # )
2179     [\040\t]* )* # If comment found, allow more spaces.
2180     (?:
2181     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2182     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2183     |
2184     \[ # [
2185     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2186     \] # ]
2187     )
2188     [\040\t]* # Nab whitespace.
2189     (?:
2190     \( # (
2191     [^\\\x80-\xff\n\015()] * # normal*
2192     (?: # (
2193     (?: \\ [^\x80-\xff] |
2194     \( # (
2195     [^\\\x80-\xff\n\015()] * # normal*
2196     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2197     \) # )
2198     ) # special
2199     [^\\\x80-\xff\n\015()] * # normal*
2200     )* # )*
2201     \) # )
2202     [\040\t]* )* # If comment found, allow more spaces.
2203     # optional trailing comments
2204     (?:
2205     \.
2206     [\040\t]* # Nab whitespace.
2207     (?:
2208     \( # (
2209     [^\\\x80-\xff\n\015()] * # normal*
2210     (?: # (
2211     (?: \\ [^\x80-\xff] |
2212     \( # (
2213     [^\\\x80-\xff\n\015()] * # normal*
2214     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2215     \) # )
2216     ) # special
2217     [^\\\x80-\xff\n\015()] * # normal*
2218     )* # )*
2219     \) # )
2220     [\040\t]* )* # If comment found, allow more spaces.
2221     (?:
2222     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2223     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2224     |
2225     \[ # [
2226     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2227     \] # ]
2228     )
2229     [\040\t]* # Nab whitespace.
2230     (?:
2231     \( # (
2232     [^\\\x80-\xff\n\015()] * # normal*
2233     (?: # (
2234     (?: \\ [^\x80-\xff] |
2235     \( # (
2236     [^\\\x80-\xff\n\015()] * # normal*
2237     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2238     \) # )
2239     ) # special
2240     [^\\\x80-\xff\n\015()] * # normal*
2241     )* # )*
2242     \) # )
2243     [\040\t]* )* # If comment found, allow more spaces.
2244     # optional trailing comments
2245     )*
2246     # address
2247     | # or
2248     (?:
2249     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2250     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2251     # Atom
2252     | # or
2253     " # "
2254     [^\\\x80-\xff\n\015"] * # normal
2255     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
2256     " # "
2257     # Quoted string
2258     )
2259     # leading word
2260     [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces
2261     (?:
2262     (?:
2263     \( # (
2264     [^\\\x80-\xff\n\015()] * # normal*
2265     (?: # (
2266     (?: \\ [^\x80-\xff] |
2267     \( # (
2268     [^\\\x80-\xff\n\015()] * # normal*
2269     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2270     \) # )
2271     ) # special
2272     [^\\\x80-\xff\n\015()] * # normal*
2273     )* # )*
2274     \) # )
2275     |
2276     " # "
2277     [^\\\x80-\xff\n\015"] * # normal
2278     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
2279     " # "
2280     ) # "special" comment or quoted string
2281     [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal"
2282     )*
2283     <
2284     [\040\t]* # Nab whitespace.
2285     (?:
2286     \( # (
2287     [^\\\x80-\xff\n\015()] * # normal*
2288     (?: # (
2289     (?: \\ [^\x80-\xff] |
2290     \( # (
2291     [^\\\x80-\xff\n\015()] * # normal*
2292     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2293     \) # )
2294     ) # special
2295     [^\\\x80-\xff\n\015()] * # normal*
2296     )* # )*
2297     \) # )
2298     [\040\t]* )* # If comment found, allow more spaces.
2299     # <
2300     (?:
2301     @
2302     [\040\t]* # Nab whitespace.
2303     (?:
2304     \( # (
2305     [^\\\x80-\xff\n\015()] * # normal*
2306     (?: # (
2307     (?: \\ [^\x80-\xff] |
2308     \( # (
2309     [^\\\x80-\xff\n\015()] * # normal*
2310     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2311     \) # )
2312     ) # special
2313     [^\\\x80-\xff\n\015()] * # normal*
2314     )* # )*
2315     \) # )
2316     [\040\t]* )* # If comment found, allow more spaces.
2317     (?:
2318     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2319     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2320     |
2321     \[ # [
2322     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2323     \] # ]
2324     )
2325     [\040\t]* # Nab whitespace.
2326     (?:
2327     \( # (
2328     [^\\\x80-\xff\n\015()] * # normal*
2329     (?: # (
2330     (?: \\ [^\x80-\xff] |
2331     \( # (
2332     [^\\\x80-\xff\n\015()] * # normal*
2333     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2334     \) # )
2335     ) # special
2336     [^\\\x80-\xff\n\015()] * # normal*
2337     )* # )*
2338     \) # )
2339     [\040\t]* )* # If comment found, allow more spaces.
2340     # optional trailing comments
2341     (?:
2342     \.
2343     [\040\t]* # Nab whitespace.
2344     (?:
2345     \( # (
2346     [^\\\x80-\xff\n\015()] * # normal*
2347     (?: # (
2348     (?: \\ [^\x80-\xff] |
2349     \( # (
2350     [^\\\x80-\xff\n\015()] * # normal*
2351     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2352     \) # )
2353     ) # special
2354     [^\\\x80-\xff\n\015()] * # normal*
2355     )* # )*
2356     \) # )
2357     [\040\t]* )* # If comment found, allow more spaces.
2358     (?:
2359     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2360     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2361     |
2362     \[ # [
2363     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2364     \] # ]
2365     )
2366     [\040\t]* # Nab whitespace.
2367     (?:
2368     \( # (
2369     [^\\\x80-\xff\n\015()] * # normal*
2370     (?: # (
2371     (?: \\ [^\x80-\xff] |
2372     \( # (
2373     [^\\\x80-\xff\n\015()] * # normal*
2374     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2375     \) # )
2376     ) # special
2377     [^\\\x80-\xff\n\015()] * # normal*
2378     )* # )*
2379     \) # )
2380     [\040\t]* )* # If comment found, allow more spaces.
2381     # optional trailing comments
2382     )*
2383     (?: ,
2384     [\040\t]* # Nab whitespace.
2385     (?:
2386     \( # (
2387     [^\\\x80-\xff\n\015()] * # normal*
2388     (?: # (
2389     (?: \\ [^\x80-\xff] |
2390     \( # (
2391     [^\\\x80-\xff\n\015()] * # normal*
2392     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2393     \) # )
2394     ) # special
2395     [^\\\x80-\xff\n\015()] * # normal*
2396     )* # )*
2397     \) # )
2398     [\040\t]* )* # If comment found, allow more spaces.
2399     @
2400     [\040\t]* # Nab whitespace.
2401     (?:
2402     \( # (
2403     [^\\\x80-\xff\n\015()] * # normal*
2404     (?: # (
2405     (?: \\ [^\x80-\xff] |
2406     \( # (
2407     [^\\\x80-\xff\n\015()] * # normal*
2408     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2409     \) # )
2410     ) # special
2411     [^\\\x80-\xff\n\015()] * # normal*
2412     )* # )*
2413     \) # )
2414     [\040\t]* )* # If comment found, allow more spaces.
2415     (?:
2416     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2417     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2418     |
2419     \[ # [
2420     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2421     \] # ]
2422     )
2423     [\040\t]* # Nab whitespace.
2424     (?:
2425     \( # (
2426     [^\\\x80-\xff\n\015()] * # normal*
2427     (?: # (
2428     (?: \\ [^\x80-\xff] |
2429     \( # (
2430     [^\\\x80-\xff\n\015()] * # normal*
2431     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2432     \) # )
2433     ) # special
2434     [^\\\x80-\xff\n\015()] * # normal*
2435     )* # )*
2436     \) # )
2437     [\040\t]* )* # If comment found, allow more spaces.
2438     # optional trailing comments
2439     (?:
2440     \.
2441     [\040\t]* # Nab whitespace.
2442     (?:
2443     \( # (
2444     [^\\\x80-\xff\n\015()] * # normal*
2445     (?: # (
2446     (?: \\ [^\x80-\xff] |
2447     \( # (
2448     [^\\\x80-\xff\n\015()] * # normal*
2449     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2450     \) # )
2451     ) # special
2452     [^\\\x80-\xff\n\015()] * # normal*
2453     )* # )*
2454     \) # )
2455     [\040\t]* )* # If comment found, allow more spaces.
2456     (?:
2457     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2458     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2459     |
2460     \[ # [
2461     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2462     \] # ]
2463     )
2464     [\040\t]* # Nab whitespace.
2465     (?:
2466     \( # (
2467     [^\\\x80-\xff\n\015()] * # normal*
2468     (?: # (
2469     (?: \\ [^\x80-\xff] |
2470     \( # (
2471     [^\\\x80-\xff\n\015()] * # normal*
2472     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2473     \) # )
2474     ) # special
2475     [^\\\x80-\xff\n\015()] * # normal*
2476     )* # )*
2477     \) # )
2478     [\040\t]* )* # If comment found, allow more spaces.
2479     # optional trailing comments
2480     )*
2481     )* # additional domains
2482     :
2483     [\040\t]* # Nab whitespace.
2484     (?:
2485     \( # (
2486     [^\\\x80-\xff\n\015()] * # normal*
2487     (?: # (
2488     (?: \\ [^\x80-\xff] |
2489     \( # (
2490     [^\\\x80-\xff\n\015()] * # normal*
2491     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2492     \) # )
2493     ) # special
2494     [^\\\x80-\xff\n\015()] * # normal*
2495     )* # )*
2496     \) # )
2497     [\040\t]* )* # If comment found, allow more spaces.
2498     # optional trailing comments
2499     )? # optional route
2500     (?:
2501     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2502     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2503     # Atom
2504     | # or
2505     " # "
2506     [^\\\x80-\xff\n\015"] * # normal
2507     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
2508     " # "
2509     # Quoted string
2510     )
2511     [\040\t]* # Nab whitespace.
2512     (?:
2513     \( # (
2514     [^\\\x80-\xff\n\015()] * # normal*
2515     (?: # (
2516     (?: \\ [^\x80-\xff] |
2517     \( # (
2518     [^\\\x80-\xff\n\015()] * # normal*
2519     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2520     \) # )
2521     ) # special
2522     [^\\\x80-\xff\n\015()] * # normal*
2523     )* # )*
2524     \) # )
2525     [\040\t]* )* # If comment found, allow more spaces.
2526     (?:
2527     \.
2528     [\040\t]* # Nab whitespace.
2529     (?:
2530     \( # (
2531     [^\\\x80-\xff\n\015()] * # normal*
2532     (?: # (
2533     (?: \\ [^\x80-\xff] |
2534     \( # (
2535     [^\\\x80-\xff\n\015()] * # normal*
2536     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2537     \) # )
2538     ) # special
2539     [^\\\x80-\xff\n\015()] * # normal*
2540     )* # )*
2541     \) # )
2542     [\040\t]* )* # If comment found, allow more spaces.
2543     (?:
2544     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2545     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2546     # Atom
2547     | # or
2548     " # "
2549     [^\\\x80-\xff\n\015"] * # normal
2550     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
2551     " # "
2552     # Quoted string
2553     )
2554     [\040\t]* # Nab whitespace.
2555     (?:
2556     \( # (
2557     [^\\\x80-\xff\n\015()] * # normal*
2558     (?: # (
2559     (?: \\ [^\x80-\xff] |
2560     \( # (
2561     [^\\\x80-\xff\n\015()] * # normal*
2562     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2563     \) # )
2564     ) # special
2565     [^\\\x80-\xff\n\015()] * # normal*
2566     )* # )*
2567     \) # )
2568     [\040\t]* )* # If comment found, allow more spaces.
2569     # additional words
2570     )*
2571     @
2572     [\040\t]* # Nab whitespace.
2573     (?:
2574     \( # (
2575     [^\\\x80-\xff\n\015()] * # normal*
2576     (?: # (
2577     (?: \\ [^\x80-\xff] |
2578     \( # (
2579     [^\\\x80-\xff\n\015()] * # normal*
2580     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2581     \) # )
2582     ) # special
2583     [^\\\x80-\xff\n\015()] * # normal*
2584     )* # )*
2585     \) # )
2586     [\040\t]* )* # If comment found, allow more spaces.
2587     (?:
2588     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2589     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2590     |
2591     \[ # [
2592     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2593     \] # ]
2594     )
2595     [\040\t]* # Nab whitespace.
2596     (?:
2597     \( # (
2598     [^\\\x80-\xff\n\015()] * # normal*
2599     (?: # (
2600     (?: \\ [^\x80-\xff] |
2601     \( # (
2602     [^\\\x80-\xff\n\015()] * # normal*
2603     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2604     \) # )
2605     ) # special
2606     [^\\\x80-\xff\n\015()] * # normal*
2607     )* # )*
2608     \) # )
2609     [\040\t]* )* # If comment found, allow more spaces.
2610     # optional trailing comments
2611     (?:
2612     \.
2613     [\040\t]* # Nab whitespace.
2614     (?:
2615     \( # (
2616     [^\\\x80-\xff\n\015()] * # normal*
2617     (?: # (
2618     (?: \\ [^\x80-\xff] |
2619     \( # (
2620     [^\\\x80-\xff\n\015()] * # normal*
2621     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2622     \) # )
2623     ) # special
2624     [^\\\x80-\xff\n\015()] * # normal*
2625     )* # )*
2626     \) # )
2627     [\040\t]* )* # If comment found, allow more spaces.
2628     (?:
2629     [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
2630     (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
2631     |
2632     \[ # [
2633     (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
2634     \] # ]
2635     )
2636     [\040\t]* # Nab whitespace.
2637     (?:
2638     \( # (
2639     [^\\\x80-\xff\n\015()] * # normal*
2640     (?: # (
2641     (?: \\ [^\x80-\xff] |
2642     \( # (
2643     [^\\\x80-\xff\n\015()] * # normal*
2644     (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
2645     \) # )
2646     ) # special
2647     [^\\\x80-\xff\n\015()] * # normal*
2648     )* # )*
2649     \) # )
2650     [\040\t]* )* # If comment found, allow more spaces.
2651     # optional trailing comments
2652     )*
2653     # address spec
2654     > # >
2655     # name and address
2656     )
2657     /x
2658     Alan Other <user\@dom.ain>
2659     0: Alan Other <user@dom.ain>
2660     <user\@dom.ain>
2661     0: user@dom.ain
2662     1: user@dom
2663     user\@dom.ain
2664     0: user@dom.ain
2665     1: user@dom
2666     \"A. Other\" <user.1234\@dom.ain> (a comment)
2667     0: "A. Other" <user.1234@dom.ain>
2668     A. Other <user.1234\@dom.ain> (a comment)
2669     0: Other <user.1234@dom.ain>
2670     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
2671     0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay
2672     1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re
2673     A missing angle <user\@some.where
2674     0: user@some.where
2675     1: user@some
2676     *** Failers
2677     No match
2678     The quick brown fox
2679     No match
2680    
2681     /abc\0def\00pqr\000xyz\0000AB/
2682     abc\0def\00pqr\000xyz\0000AB
2683     0: abc\x00def\x00pqr\x00xyz\x000AB
2684     abc456 abc\0def\00pqr\000xyz\0000ABCDE
2685     0: abc\x00def\x00pqr\x00xyz\x000AB
2686    
2687     /abc\x0def\x00pqr\x000xyz\x0000AB/
2688     abc\x0def\x00pqr\x000xyz\x0000AB
2689     0: abc\x0def\x00pqr\x000xyz\x0000AB
2690     abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE
2691     0: abc\x0def\x00pqr\x000xyz\x0000AB
2692    
2693     /^[\000-\037]/
2694     \0A
2695     0: \x00
2696     \01B
2697     0: \x01
2698     \037C
2699     0: \x1f
2700    
2701     /\0*/
2702     \0\0\0\0
2703     0: \x00\x00\x00\x00
2704     1: \x00\x00\x00
2705     2: \x00\x00
2706     3: \x00
2707     4:
2708    
2709     /A\x0{2,3}Z/
2710     The A\x0\x0Z
2711     0: A\x00\x00Z
2712     An A\0\x0\0Z
2713     0: A\x00\x00\x00Z
2714     *** Failers
2715     No match
2716     A\0Z
2717     No match
2718     A\0\x0\0\x0Z
2719     No match
2720    
2721     /^\s/
2722     \040abc
2723     0:
2724     \x0cabc
2725     0: \x0c
2726     \nabc
2727     0: \x0a
2728     \rabc
2729     0: \x0d
2730     \tabc
2731     0: \x09
2732     *** Failers
2733     No match
2734     abc
2735     No match
2736    
2737     /^a b
2738    
2739     c/x
2740     abc
2741     0: abc
2742    
2743     /ab{1,3}bc/
2744     abbbbc
2745     0: abbbbc
2746     abbbc
2747     0: abbbc
2748     abbc
2749     0: abbc
2750     *** Failers
2751     No match
2752     abc
2753     No match
2754     abbbbbc
2755     No match
2756    
2757     /([^.]*)\.([^:]*):[T ]+(.*)/
2758     track1.title:TBlah blah blah
2759     0: track1.title:TBlah blah blah
2760     1: track1.title:TBlah blah bla
2761     2: track1.title:TBlah blah bl
2762     3: track1.title:TBlah blah b
2763     4: track1.title:TBlah blah
2764     5: track1.title:TBlah blah
2765     6: track1.title:TBlah bla
2766     7: track1.title:TBlah bl
2767     8: track1.title:TBlah b
2768     9: track1.title:TBlah
2769     10: track1.title:TBlah
2770     11: track1.title:TBla
2771     12: track1.title:TBl
2772     13: track1.title:TB
2773     14: track1.title:T
2774    
2775     /([^.]*)\.([^:]*):[T ]+(.*)/i
2776     track1.title:TBlah blah blah
2777     0: track1.title:TBlah blah blah
2778     1: track1.title:TBlah blah bla
2779     2: track1.title:TBlah blah bl
2780     3: track1.title:TBlah blah b
2781     4: track1.title:TBlah blah
2782     5: track1.title:TBlah blah
2783     6: track1.title:TBlah bla
2784     7: track1.title:TBlah bl
2785     8: track1.title:TBlah b
2786     9: track1.title:TBlah
2787     10: track1.title:TBlah
2788     11: track1.title:TBla
2789     12: track1.title:TBl
2790     13: track1.title:TB
2791     14: track1.title:T
2792    
2793     /([^.]*)\.([^:]*):[t ]+(.*)/i
2794     track1.title:TBlah blah blah
2795     0: track1.title:TBlah blah blah
2796     1: track1.title:TBlah blah bla
2797     2: track1.title:TBlah blah bl
2798     3: track1.title:TBlah blah b
2799     4: track1.title:TBlah blah
2800     5: track1.title:TBlah blah
2801     6: track1.title:TBlah bla
2802     7: track1.title:TBlah bl
2803     8: track1.title:TBlah b
2804     9: track1.title:TBlah
2805     10: track1.title:TBlah
2806     11: track1.title:TBla
2807     12: track1.title:TBl
2808     13: track1.title:TB
2809     14: track1.title:T
2810    
2811     /^[W-c]+$/
2812     WXY_^abc
2813     0: WXY_^abc
2814     *** Failers
2815     No match
2816     wxy
2817     No match
2818    
2819     /^[W-c]+$/i
2820     WXY_^abc
2821     0: WXY_^abc
2822     wxy_^ABC
2823     0: wxy_^ABC
2824    
2825     /^[\x3f-\x5F]+$/i
2826     WXY_^abc
2827     0: WXY_^abc
2828     wxy_^ABC
2829     0: wxy_^ABC
2830    
2831     /^abc$/m
2832     abc
2833     0: abc
2834     qqq\nabc
2835     0: abc
2836     abc\nzzz
2837     0: abc
2838     qqq\nabc\nzzz
2839     0: abc
2840    
2841     /^abc$/
2842     abc
2843     0: abc
2844     *** Failers
2845     No match
2846     qqq\nabc
2847     No match
2848     abc\nzzz
2849     No match
2850     qqq\nabc\nzzz
2851     No match
2852    
2853     /\Aabc\Z/m
2854     abc
2855     0: abc
2856     abc\n
2857     0: abc
2858     *** Failers
2859     No match
2860     qqq\nabc
2861     No match
2862     abc\nzzz
2863     No match
2864     qqq\nabc\nzzz
2865     No match
2866    
2867     /\A(.)*\Z/s
2868     abc\ndef
2869     0: abc\x0adef
2870    
2871     /\A(.)*\Z/m
2872     *** Failers
2873     0: *** Failers
2874     abc\ndef
2875     No match
2876    
2877     /(?:b)|(?::+)/
2878     b::c
2879     0: b
2880     c::b
2881     0: ::
2882     1: :
2883    
2884     /[-az]+/
2885     az-
2886     0: az-
2887     1: az
2888     2: a
2889     *** Failers
2890     0: a
2891     b
2892     No match
2893    
2894     /[az-]+/
2895     za-
2896     0: za-
2897     1: za
2898     2: z
2899     *** Failers
2900     0: a
2901     b
2902     No match
2903    
2904     /[a\-z]+/
2905     a-z
2906     0: a-z
2907     1: a-
2908     2: a
2909     *** Failers
2910     0: a
2911     b
2912     No match
2913    
2914     /[a-z]+/
2915     abcdxyz
2916     0: abcdxyz
2917     1: abcdxy
2918     2: abcdx
2919     3: abcd
2920     4: abc
2921     5: ab
2922     6: a
2923    
2924     /[\d-]+/
2925     12-34
2926     0: 12-34
2927     1: 12-3
2928     2: 12-
2929     3: 12
2930     4: 1
2931     *** Failers
2932     No match
2933     aaa
2934     No match
2935    
2936     /[\d-z]+/
2937     12-34z
2938     0: 12-34z
2939     1: 12-34
2940     2: 12-3
2941     3: 12-
2942     4: 12
2943     5: 1
2944     *** Failers
2945     No match
2946     aaa
2947     No match
2948    
2949     /\x5c/
2950     \\
2951     0: \
2952    
2953     /\x20Z/
2954     the Zoo
2955     0: Z
2956     *** Failers
2957     No match
2958     Zulu
2959     No match
2960    
2961     /ab{3cd/
2962     ab{3cd
2963     0: ab{3cd
2964    
2965     /ab{3,cd/
2966     ab{3,cd
2967     0: ab{3,cd
2968    
2969     /ab{3,4a}cd/
2970     ab{3,4a}cd
2971     0: ab{3,4a}cd
2972    
2973     /{4,5a}bc/
2974     {4,5a}bc
2975     0: {4,5a}bc
2976    
2977     /^a.b/
2978     a\rb
2979     0: a\x0db
2980     *** Failers
2981     No match
2982     a\nb
2983     No match
2984    
2985     /abc$/
2986     abc
2987     0: abc
2988     abc\n
2989     0: abc
2990     *** Failers
2991     No match
2992     abc\ndef
2993     No match
2994    
2995     /(abc)\123/
2996     abc\x53
2997     0: abcS
2998    
2999     /(abc)\223/
3000     abc\x93
3001     0: abc\x93
3002    
3003     /(abc)\323/
3004     abc\xd3
3005     0: abc\xd3
3006    
3007 nigel 91 /(abc)\100/
3008 nigel 77 abc\x40
3009     0: abc@
3010     abc\100
3011     0: abc@
3012    
3013 nigel 91 /(abc)\1000/
3014 nigel 77 abc\x400
3015     0: abc@0
3016     abc\x40\x30
3017     0: abc@0
3018     abc\1000
3019     0: abc@0
3020     abc\100\x30
3021     0: abc@0
3022     abc\100\060
3023     0: abc@0
3024     abc\100\60
3025     0: abc@0
3026    
3027     /abc\81/
3028     abc\081
3029     0: abc\x0081
3030     abc\0\x38\x31
3031     0: abc\x0081
3032    
3033     /abc\91/
3034     abc\091
3035     0: abc\x0091
3036     abc\0\x39\x31
3037     0: abc\x0091
3038    
3039     /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
3040     abcdefghijk\12S
3041     0: abcdefghijk\x0aS
3042    
3043     /ab\gdef/
3044     abgdef
3045     0: abgdef
3046    
3047     /a{0}bc/
3048     bc
3049     0: bc
3050    
3051     /(a|(bc)){0,0}?xyz/
3052     xyz
3053     0: xyz
3054    
3055     /abc[\10]de/
3056     abc\010de
3057     0: abc\x08de
3058    
3059     /abc[\1]de/
3060     abc\1de
3061     0: abc\x01de
3062    
3063     /(abc)[\1]de/
3064     abc\1de
3065     0: abc\x01de
3066    
3067     /(?s)a.b/
3068     a\nb
3069     0: a\x0ab
3070    
3071     /^([^a])([^\b])([^c]*)([^d]{3,4})/
3072     baNOTccccd
3073     0: baNOTcccc
3074     1: baNOTccc
3075     2: baNOTcc
3076     3: baNOTc
3077     4: baNOT
3078     baNOTcccd
3079     0: baNOTccc
3080     1: baNOTcc
3081     2: baNOTc
3082     3: baNOT
3083     baNOTccd
3084     0: baNOTcc
3085     1: baNOTc
3086     2: baNOT
3087     bacccd
3088     0: baccc
3089     *** Failers
3090     0: *** Failers
3091     1: *** Failer
3092     2: *** Faile
3093     3: *** Fail
3094     4: *** Fai
3095     5: *** Fa
3096     6: *** F
3097     anything
3098     No match
3099     b\bc
3100     No match
3101     baccd
3102     No match
3103    
3104     /[^a]/
3105     Abc
3106     0: A
3107    
3108     /[^a]/i
3109     Abc
3110     0: b
3111    
3112     /[^a]+/
3113     AAAaAbc
3114     0: AAA
3115     1: AA
3116     2: A
3117    
3118     /[^a]+/i
3119     AAAaAbc
3120     0: bc
3121     1: b
3122    
3123     /[^a]+/
3124     bbb\nccc
3125     0: bbb\x0accc
3126     1: bbb\x0acc
3127     2: bbb\x0ac
3128     3: bbb\x0a
3129     4: bbb
3130     5: bb
3131     6: b
3132    
3133     /[^k]$/
3134     abc
3135     0: c
3136     *** Failers
3137     0: s
3138     abk
3139     No match
3140    
3141     /[^k]{2,3}$/
3142     abc
3143     0: abc
3144     kbc
3145     0: bc
3146     kabc
3147     0: abc
3148     *** Failers
3149     0: ers
3150     abk
3151     No match
3152     akb
3153     No match
3154     akk
3155     No match
3156    
3157     /^\d{8,}\@.+[^k]$/
3158     12345678\@a.b.c.d
3159     0: 12345678@a.b.c.d
3160     123456789\@x.y.z
3161     0: 123456789@x.y.z
3162     *** Failers
3163     No match
3164     12345678\@x.y.uk
3165     No match
3166     1234567\@a.b.c.d
3167     No match
3168    
3169     /[^a]/
3170     aaaabcd
3171     0: b
3172     aaAabcd
3173     0: A
3174    
3175     /[^a]/i
3176     aaaabcd
3177     0: b
3178     aaAabcd
3179     0: b
3180    
3181     /[^az]/
3182     aaaabcd
3183     0: b
3184     aaAabcd
3185     0: A
3186    
3187     /[^az]/i
3188     aaaabcd
3189     0: b
3190     aaAabcd
3191     0: b
3192    
3193     /\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/
3194     \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
3195     0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff
3196    
3197     /P[^*]TAIRE[^*]{1,6}?LL/
3198     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
3199     0: PSTAIREISLL
3200    
3201     /P[^*]TAIRE[^*]{1,}?LL/
3202     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
3203     0: PSTAIREISLL
3204    
3205     /(\.\d\d[1-9]?)\d+/
3206     1.230003938
3207     0: .230003938
3208     1: .23000393
3209     2: .2300039
3210     3: .230003
3211     4: .23000
3212     5: .2300
3213     6: .230
3214     1.875000282
3215     0: .875000282
3216     1: .87500028
3217     2: .8750002
3218     3: .875000
3219     4: .87500
3220     5: .8750
3221     6: .875
3222     1.235
3223     0: .235
3224    
3225     /(\.\d\d((?=0)|\d(?=\d)))/
3226     1.230003938
3227     0: .230
3228     1: .23
3229     1.875000282
3230     0: .875
3231     *** Failers
3232     No match
3233     1.235
3234     No match
3235    
3236     /a(?)b/
3237     ab
3238     0: ab
3239    
3240     /\b(foo)\s+(\w+)/i
3241     Food is on the foo table
3242     0: foo table
3243     1: foo tabl
3244     2: foo tab
3245     3: foo ta
3246     4: foo t
3247    
3248     /foo(.*)bar/
3249     The food is under the bar in the barn.
3250     0: food is under the bar in the bar
3251     1: food is under the bar
3252    
3253     /foo(.*?)bar/
3254     The food is under the bar in the barn.
3255     0: food is under the bar in the bar
3256     1: food is under the bar
3257    
3258     /(.*)(\d*)/
3259     I have 2 numbers: 53147
3260     Matched, but too many subsidiary matches
3261     0: I have 2 numbers: 53147
3262     1: I have 2 numbers: 5314
3263     2: I have 2 numbers: 531
3264     3: I have 2 numbers: 53
3265     4: I have 2 numbers: 5
3266     5: I have 2 numbers:
3267     6: I have 2 numbers:
3268     7: I have 2 numbers
3269     8: I have 2 number
3270     9: I have 2 numbe
3271     10: I have 2 numb
3272     11: I have 2 num
3273     12: I have 2 nu
3274     13: I have 2 n
3275     14: I have 2
3276     15: I have 2
3277     16: I have
3278     17: I have
3279     18: I hav
3280     19: I ha
3281     20: I h
3282     21: I
3283    
3284     /(.*)(\d+)/
3285     I have 2 numbers: 53147
3286     0: I have 2 numbers: 53147
3287     1: I have 2 numbers: 5314
3288     2: I have 2 numbers: 531
3289     3: I have 2 numbers: 53
3290     4: I have 2 numbers: 5
3291     5: I have 2
3292    
3293     /(.*?)(\d*)/
3294     I have 2 numbers: 53147
3295     Matched, but too many subsidiary matches
3296     0: I have 2 numbers: 53147
3297     1: I have 2 numbers: 5314
3298     2: I have 2 numbers: 531
3299     3: I have 2 numbers: 53
3300     4: I have 2 numbers: 5
3301     5: I have 2 numbers:
3302     6: I have 2 numbers:
3303     7: I have 2 numbers
3304     8: I have 2 number
3305     9: I have 2 numbe
3306     10: I have 2 numb
3307     11: I have 2 num
3308     12: I have 2 nu
3309     13: I have 2 n
3310     14: I have 2
3311     15: I have 2
3312     16: I have
3313     17: I have
3314     18: I hav
3315     19: I ha
3316     20: I h
3317     21: I
3318    
3319     /(.*?)(\d+)/
3320     I have 2 numbers: 53147
3321     0: I have 2 numbers: 53147
3322     1: I have 2 numbers: 5314
3323     2: I have 2 numbers: 531
3324     3: I have 2 numbers: 53
3325     4: I have 2 numbers: 5
3326     5: I have 2
3327    
3328     /(.*)(\d+)$/
3329     I have 2 numbers: 53147
3330     0: I have 2 numbers: 53147
3331    
3332     /(.*?)(\d+)$/
3333     I have 2 numbers: 53147
3334     0: I have 2 numbers: 53147
3335    
3336     /(.*)\b(\d+)$/
3337     I have 2 numbers: 53147
3338     0: I have 2 numbers: 53147
3339    
3340     /(.*\D)(\d+)$/
3341     I have 2 numbers: 53147
3342     0: I have 2 numbers: 53147
3343    
3344     /^\D*(?!123)/
3345     ABC123
3346     0: AB
3347     1: A
3348     2:
3349    
3350     /^(\D*)(?=\d)(?!123)/
3351     ABC445
3352     0: ABC
3353     *** Failers
3354     No match
3355     ABC123
3356     No match
3357    
3358     /^[W-]46]/
3359     W46]789
3360     0: W46]
3361     -46]789
3362     0: -46]
3363     *** Failers
3364     No match
3365     Wall
3366     No match
3367     Zebra
3368     No match
3369     42
3370     No match
3371     [abcd]
3372     No match
3373     ]abcd[
3374     No match
3375    
3376     /^[W-\]46]/
3377     W46]789
3378     0: W
3379     Wall
3380     0: W
3381     Zebra
3382     0: Z
3383     Xylophone
3384     0: X
3385     42
3386     0: 4
3387     [abcd]
3388     0: [
3389     ]abcd[
3390     0: ]
3391     \\backslash
3392     0: \
3393     *** Failers
3394     No match
3395     -46]789
3396     No match
3397     well
3398     No match
3399    
3400     /\d\d\/\d\d\/\d\d\d\d/
3401     01/01/2000
3402     0: 01/01/2000
3403    
3404     /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
3405     word cat dog elephant mussel cow horse canary baboon snake shark otherword
3406     0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
3407     word cat dog elephant mussel cow horse canary baboon snake shark
3408     No match
3409    
3410     /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
3411     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
3412     No match
3413    
3414     /^(a){0,0}/
3415     bcd
3416     0:
3417     abc
3418     0:
3419     aab
3420     0:
3421    
3422     /^(a){0,1}/
3423     bcd
3424     0:
3425     abc
3426     0: a
3427     1:
3428     aab
3429     0: a
3430     1:
3431    
3432     /^(a){0,2}/
3433     bcd
3434     0:
3435     abc
3436     0: a
3437     1:
3438     aab
3439     0: aa
3440     1: a
3441     2:
3442    
3443     /^(a){0,3}/
3444     bcd
3445     0:
3446     abc
3447     0: a
3448     1:
3449     aab
3450     0: aa
3451     1: a
3452     2:
3453     aaa
3454     0: aaa
3455     1: aa
3456     2: a
3457     3:
3458    
3459     /^(a){0,}/
3460     bcd
3461     0:
3462     abc
3463     0: a
3464     1:
3465     aab
3466     0: aa
3467     1: a
3468     2:
3469     aaa
3470     0: aaa
3471     1: aa
3472     2: a
3473     3:
3474     aaaaaaaa
3475     0: aaaaaaaa
3476     1: aaaaaaa
3477     2: aaaaaa
3478     3: aaaaa
3479     4: aaaa
3480     5: aaa
3481     6: aa
3482     7: a
3483     8:
3484    
3485     /^(a){1,1}/
3486     bcd
3487     No match
3488     abc
3489     0: a
3490     aab
3491     0: a
3492    
3493     /^(a){1,2}/
3494     bcd
3495     No match
3496     abc
3497     0: a
3498     aab
3499     0: aa
3500     1: a
3501    
3502     /^(a){1,3}/
3503     bcd
3504     No match
3505     abc
3506     0: a
3507     aab
3508     0: aa
3509     1: a
3510     aaa
3511     0: aaa
3512     1: aa
3513     2: a
3514    
3515     /^(a){1,}/
3516     bcd
3517     No match
3518     abc
3519     0: a
3520     aab
3521     0: aa
3522     1: a
3523     aaa
3524     0: aaa
3525     1: aa
3526     2: a
3527     aaaaaaaa
3528     0: aaaaaaaa
3529     1: aaaaaaa
3530     2: aaaaaa
3531     3: aaaaa
3532     4: aaaa
3533     5: aaa
3534     6: aa
3535     7: a
3536    
3537     /.*\.gif/
3538     borfle\nbib.gif\nno
3539     0: bib.gif
3540    
3541     /.{0,}\.gif/
3542     borfle\nbib.gif\nno
3543     0: bib.gif
3544    
3545     /.*\.gif/m
3546     borfle\nbib.gif\nno
3547     0: bib.gif
3548    
3549     /.*\.gif/s
3550     borfle\nbib.gif\nno
3551     0: borfle\x0abib.gif
3552    
3553     /.*\.gif/ms
3554     borfle\nbib.gif\nno
3555     0: borfle\x0abib.gif
3556    
3557     /.*$/
3558     borfle\nbib.gif\nno
3559     0: no
3560    
3561     /.*$/m
3562     borfle\nbib.gif\nno
3563     0: borfle
3564    
3565     /.*$/s
3566     borfle\nbib.gif\nno
3567     0: borfle\x0abib.gif\x0ano
3568    
3569     /.*$/ms
3570     borfle\nbib.gif\nno
3571     0: borfle\x0abib.gif\x0ano
3572     1: borfle\x0abib.gif
3573     2: borfle
3574    
3575     /.*$/
3576     borfle\nbib.gif\nno\n
3577     0: no
3578    
3579     /.*$/m
3580     borfle\nbib.gif\nno\n
3581     0: borfle
3582    
3583     /.*$/s
3584     borfle\nbib.gif\nno\n
3585     0: borfle\x0abib.gif\x0ano\x0a
3586     1: borfle\x0abib.gif\x0ano
3587    
3588     /.*$/ms
3589     borfle\nbib.gif\nno\n
3590     0: borfle\x0abib.gif\x0ano\x0a
3591     1: borfle\x0abib.gif\x0ano
3592     2: borfle\x0abib.gif
3593     3: borfle
3594    
3595     /(.*X|^B)/
3596     abcde\n1234Xyz
3597     0: 1234X
3598     BarFoo
3599     0: B
3600     *** Failers
3601     No match
3602     abcde\nBar
3603     No match
3604    
3605     /(.*X|^B)/m
3606     abcde\n1234Xyz
3607     0: 1234X
3608     BarFoo
3609     0: B
3610     abcde\nBar
3611     0: B
3612    
3613     /(.*X|^B)/s
3614     abcde\n1234Xyz
3615     0: abcde\x0a1234X
3616     BarFoo
3617     0: B
3618     *** Failers
3619     No match
3620     abcde\nBar
3621     No match
3622    
3623     /(.*X|^B)/ms
3624     abcde\n1234Xyz
3625     0: abcde\x0a1234X
3626     BarFoo
3627     0: B
3628     abcde\nBar
3629     0: B
3630    
3631     /(?s)(.*X|^B)/
3632     abcde\n1234Xyz
3633     0: abcde\x0a1234X
3634     BarFoo
3635     0: B
3636     *** Failers
3637     No match
3638     abcde\nBar
3639     No match
3640    
3641     /(?s:.*X|^B)/
3642     abcde\n1234Xyz
3643     0: abcde\x0a1234X
3644     BarFoo
3645     0: B
3646     *** Failers
3647     No match
3648     abcde\nBar
3649     No match
3650    
3651     /^.*B/
3652     **** Failers
3653     No match
3654     abc\nB
3655     No match
3656    
3657     /(?s)^.*B/
3658     abc\nB
3659     0: abc\x0aB
3660    
3661     /(?m)^.*B/
3662     abc\nB
3663     0: B
3664    
3665     /(?ms)^.*B/
3666     abc\nB
3667     0: abc\x0aB
3668    
3669     /(?ms)^B/
3670     abc\nB
3671     0: B
3672    
3673     /(?s)B$/
3674     B\n
3675     0: B
3676    
3677     /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
3678     123456654321
3679     0: 123456654321
3680    
3681     /^\d\d\d\d\d\d\d\d\d\d\d\d/
3682     123456654321
3683     0: 123456654321
3684    
3685     /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
3686     123456654321
3687     0: 123456654321
3688    
3689     /^[abc]{12}/
3690     abcabcabcabc
3691     0: abcabcabcabc
3692    
3693     /^[a-c]{12}/
3694     abcabcabcabc
3695     0: abcabcabcabc
3696    
3697     /^(a|b|c){12}/
3698     abcabcabcabc
3699     0: abcabcabcabc
3700    
3701     /^[abcdefghijklmnopqrstuvwxy0123456789]/
3702     n
3703     0: n
3704     *** Failers
3705     No match
3706     z
3707     No match
3708    
3709     /abcde{0,0}/
3710     abcd
3711     0: abcd
3712     *** Failers
3713     No match
3714     abce
3715     No match
3716    
3717     /ab[cd]{0,0}e/
3718     abe
3719     0: abe
3720     *** Failers
3721     No match
3722     abcde
3723     No match
3724    
3725     /ab(c){0,0}d/
3726     abd
3727     0: abd
3728     *** Failers
3729     No match
3730     abcd
3731     No match
3732    
3733     /a(b*)/
3734     a
3735     0: a
3736     ab
3737     0: ab
3738     1: a
3739     abbbb
3740     0: abbbb
3741     1: abbb
3742     2: abb
3743     3: ab
3744     4: a
3745     *** Failers
3746     0: a
3747     bbbbb
3748     No match
3749    
3750     /ab\d{0}e/
3751     abe
3752     0: abe
3753     *** Failers
3754     No match
3755     ab1e
3756     No match
3757    
3758     /"([^\\"]+|\\.)*"/
3759     the \"quick\" brown fox
3760     0: "quick"
3761     \"the \\\"quick\\\" brown fox\"
3762     0: "the \"quick\" brown fox"
3763    
3764     /.*?/g+
3765     abc
3766     0: abc
3767     0+
3768     1: ab
3769     2: a
3770     3:
3771     0:
3772     0+
3773    
3774     /\b/g+
3775     abc
3776     0:
3777     0+ abc
3778     0:
3779     0+
3780    
3781     /\b/+g
3782     abc
3783     0:
3784     0+ abc
3785     0:
3786     0+
3787    
3788     //g
3789     abc
3790     0:
3791     0:
3792     0:
3793     0:
3794    
3795     /<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
3796     <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>
3797     0: <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>
3798    
3799     /a[^a]b/
3800     acb
3801     0: acb
3802     a\nb
3803     0: a\x0ab
3804    
3805     /a.b/
3806     acb
3807     0: acb
3808     *** Failers
3809     No match
3810     a\nb
3811     No match
3812    
3813     /a[^a]b/s
3814     acb
3815     0: acb
3816     a\nb
3817     0: a\x0ab
3818    
3819     /a.b/s
3820     acb
3821     0: acb
3822     a\nb
3823     0: a\x0ab
3824    
3825     /^(b+?|a){1,2}?c/
3826     bac
3827     0: bac
3828     bbac
3829     0: bbac
3830     bbbac
3831     0: bbbac
3832     bbbbac
3833     0: bbbbac
3834     bbbbbac
3835     0: bbbbbac
3836    
3837     /^(b+|a){1,2}?c/
3838     bac
3839     0: bac
3840     bbac
3841     0: bbac
3842     bbbac
3843     0: bbbac
3844     bbbbac
3845     0: bbbbac
3846     bbbbbac
3847     0: bbbbbac
3848    
3849     /(?!\A)x/m
3850     x\nb\n
3851     No match
3852     a\bx\n
3853     0: x
3854    
3855     /\x0{ab}/
3856     \0{ab}
3857     0: \x00{ab}
3858    
3859     /(A|B)*?CD/
3860     CD
3861     0: CD
3862    
3863     /(A|B)*CD/
3864     CD
3865     0: CD
3866    
3867     /(?<!bar)foo/
3868     foo
3869     0: foo
3870     catfood
3871     0: foo
3872     arfootle
3873     0: foo
3874     rfoosh
3875     0: foo
3876     *** Failers
3877     No match
3878     barfoo
3879     No match
3880     towbarfoo
3881     No match
3882    
3883     /\w{3}(?<!bar)foo/
3884     catfood
3885     0: catfoo
3886     *** Failers
3887     No match
3888     foo
3889     No match
3890     barfoo
3891     No match
3892     towbarfoo
3893     No match
3894    
3895     /(?<=(foo)a)bar/
3896     fooabar
3897     0: bar
3898     *** Failers
3899     No match
3900     bar
3901     No match
3902     foobbar
3903     No match
3904    
3905     /\Aabc\z/m
3906     abc
3907     0: abc
3908     *** Failers
3909     No match
3910     abc\n
3911     No match
3912     qqq\nabc
3913     No match
3914     abc\nzzz
3915     No match
3916     qqq\nabc\nzzz
3917     No match
3918    
3919     "(?>.*/)foo"
3920     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
3921     No match
3922    
3923     "(?>.*/)foo"
3924     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
3925     0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
3926    
3927     /(?>(\.\d\d[1-9]?))\d+/
3928     1.230003938
3929     0: .230003938
3930     1: .23000393
3931     2: .2300039
3932     3: .230003
3933     4: .23000
3934     5: .2300
3935     6: .230
3936     1.875000282
3937     0: .875000282
3938     1: .87500028
3939     2: .8750002
3940     3: .875000
3941     4: .87500
3942     5: .8750
3943     *** Failers
3944     No match
3945     1.235
3946     No match
3947    
3948     /^((?>\w+)|(?>\s+))*$/
3949     now is the time for all good men to come to the aid of the party
3950     0: now is the time for all good men to come to the aid of the party
3951     *** Failers
3952     No match
3953     this is not a line with only words and spaces!
3954     No match
3955    
3956     /(\d+)(\w)/
3957     12345a
3958     0: 12345a
3959     1: 12345
3960     2: 1234
3961     3: 123
3962     4: 12
3963     12345+
3964     0: 12345
3965     1: 1234
3966     2: 123
3967     3: 12
3968    
3969     /((?>\d+))(\w)/
3970     12345a
3971     0: 12345a
3972     *** Failers
3973     No match
3974     12345+
3975     No match
3976    
3977     /(?>a+)b/
3978     aaab
3979     0: aaab
3980    
3981     /((?>a+)b)/
3982     aaab
3983     0: aaab
3984    
3985     /(?>(a+))b/
3986     aaab
3987     0: aaab
3988    
3989     /(?>b)+/
3990     aaabbbccc
3991     0: bbb
3992     1: bb
3993     2: b
3994    
3995     /(?>a+|b+|c+)*c/
3996     aaabbbbccccd
3997     0: aaabbbbcccc
3998     1: aaabbbbc
3999    
4000     /(a+|b+|c+)*c/
4001     aaabbbbccccd
4002     0: aaabbbbcccc
4003     1: aaabbbbccc
4004     2: aaabbbbcc
4005     3: aaabbbbc
4006    
4007     /((?>[^()]+)|\([^()]*\))+/
4008     ((abc(ade)ufh()()x
4009     0: abc(ade)ufh()()x
4010     1: abc(ade)ufh()()
4011     2: abc(ade)ufh()
4012     3: abc(ade)ufh
4013     4: abc(ade)
4014     5: abc
4015    
4016     /\(((?>[^()]+)|\([^()]+\))+\)/
4017     (abc)
4018     0: (abc)
4019     (abc(def)xyz)
4020     0: (abc(def)xyz)
4021     *** Failers
4022     No match
4023     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
4024     No match
4025    
4026     /a(?-i)b/i
4027     ab
4028     0: ab
4029     Ab
4030     0: Ab
4031     *** Failers
4032     No match
4033     aB
4034     No match
4035     AB
4036     No match
4037    
4038     /(a (?x)b c)d e/
4039     a bcd e
4040     0: a bcd e
4041     *** Failers
4042     No match
4043     a b cd e
4044     No match
4045     abcd e
4046     No match
4047     a bcde
4048     No match
4049    
4050     /(a b(?x)c d (?-x)e f)/
4051     a bcde f
4052     0: a bcde f
4053     *** Failers
4054     No match
4055     abcdef
4056     No match
4057    
4058     /(a(?i)b)c/
4059     abc
4060     0: abc
4061     aBc
4062     0: aBc
4063     *** Failers
4064     No match
4065     abC
4066     No match
4067     aBC
4068     No match
4069     Abc
4070     No match
4071     ABc
4072     No match
4073     ABC
4074     No match
4075     AbC
4076     No match
4077    
4078     /a(?i:b)c/
4079     abc
4080     0: abc
4081     aBc
4082     0: aBc
4083     *** Failers
4084     No match
4085     ABC
4086     No match
4087     abC
4088     No match
4089     aBC
4090     No match
4091    
4092     /a(?i:b)*c/
4093     aBc
4094     0: aBc
4095     aBBc
4096     0: aBBc
4097     *** Failers
4098     No match
4099     aBC
4100     No match
4101     aBBC
4102     No match
4103    
4104     /a(?=b(?i)c)\w\wd/
4105     abcd
4106     0: abcd
4107     abCd
4108     0: abCd
4109     *** Failers
4110     No match
4111     aBCd
4112     No match
4113     abcD
4114     No match
4115    
4116     /(?s-i:more.*than).*million/i
4117     more than million
4118     0: more than million
4119     more than MILLION
4120     0: more than MILLION
4121     more \n than Million
4122     0: more \x0a than Million
4123     *** Failers
4124     No match
4125     MORE THAN MILLION
4126     No match
4127     more \n than \n million
4128     No match
4129    
4130     /(?:(?s-i)more.*than).*million/i
4131     more than million
4132     0: more than million
4133     more than MILLION
4134     0: more than MILLION
4135     more \n than Million
4136     0: more \x0a than Million
4137     *** Failers
4138     No match
4139     MORE THAN MILLION
4140     No match
4141     more \n than \n million
4142     No match
4143    
4144     /(?>a(?i)b+)+c/
4145     abc
4146     0: abc
4147     aBbc
4148     0: aBbc
4149     aBBc
4150     0: aBBc
4151     *** Failers
4152     No match
4153     Abc
4154     No match
4155     abAb
4156     No match
4157     abbC
4158     No match
4159    
4160     /(?=a(?i)b)\w\wc/
4161     abc
4162     0: abc
4163     aBc
4164     0: aBc
4165     *** Failers
4166     No match
4167     Ab
4168     No match
4169     abC
4170     No match
4171     aBC
4172     No match
4173    
4174     /(?<=a(?i)b)(\w\w)c/
4175     abxxc
4176     0: xxc
4177     aBxxc
4178     0: xxc
4179     *** Failers
4180     No match
4181     Abxxc
4182     No match
4183     ABxxc
4184     No match
4185     abxxC
4186     No match
4187    
4188     /^(?(?=abc)\w{3}:|\d\d)$/
4189     abc:
4190     0: abc:
4191     12
4192     0: 12
4193     *** Failers
4194     No match
4195     123
4196     No match
4197     xyz
4198     No match
4199    
4200     /^(?(?!abc)\d\d|\w{3}:)$/
4201     abc:
4202     0: abc:
4203     12
4204     0: 12
4205     *** Failers
4206     No match
4207     123
4208     No match
4209     xyz
4210     No match
4211    
4212     /(?(?<=foo)bar|cat)/
4213     foobar
4214     0: bar
4215     cat
4216     0: cat
4217     fcat
4218     0: cat
4219     focat
4220     0: cat
4221     *** Failers
4222     No match
4223     foocat
4224     No match
4225    
4226     /(?(?<!foo)cat|bar)/
4227     foobar
4228     0: bar
4229     cat
4230     0: cat
4231     fcat
4232     0: cat
4233     focat
4234     0: cat
4235     *** Failers
4236     No match
4237     foocat
4238     No match
4239    
4240     /(?>a*)*/
4241     a
4242     0: a
4243     1:
4244     aa
4245     0: aa
4246     1:
4247     aaaa
4248     0: aaaa
4249     1:
4250    
4251     /(abc|)+/
4252     abc
4253     0: abc
4254     1:
4255     abcabc
4256     0: abcabc
4257     1: abc
4258     2:
4259     abcabcabc
4260     0: abcabcabc
4261     1: abcabc
4262     2: abc
4263     3:
4264     xyz
4265     0:
4266    
4267     /([a]*)*/
4268     a
4269     0: a
4270     1:
4271     aaaaa
4272     0: aaaaa
4273     1: aaaa
4274     2: aaa
4275     3: aa
4276     4: a
4277     5:
4278    
4279     /([ab]*)*/
4280     a
4281     0: a
4282     1:
4283     b
4284     0: b
4285     1:
4286     ababab
4287     0: ababab
4288     1: ababa
4289     2: abab
4290     3: aba
4291     4: ab
4292     5: a
4293     6:
4294     aaaabcde
4295     0: aaaab
4296     1: aaaa
4297     2: aaa
4298     3: aa
4299     4: a
4300     5:
4301     bbbb
4302     0: bbbb
4303     1: bbb
4304     2: bb
4305     3: b
4306     4:
4307    
4308     /([^a]*)*/
4309     b
4310     0: b
4311     1:
4312     bbbb
4313     0: bbbb
4314     1: bbb
4315     2: bb
4316     3: b
4317     4:
4318     aaa
4319     0:
4320    
4321     /([^ab]*)*/
4322     cccc
4323     0: cccc
4324     1: ccc
4325     2: cc
4326     3: c
4327     4:
4328     abab
4329     0:
4330    
4331     /([a]*?)*/
4332     a
4333     0: a
4334     1:
4335     aaaa
4336     0: aaaa
4337     1: aaa
4338     2: aa
4339     3: a
4340     4:
4341    
4342     /([ab]*?)*/
4343     a
4344     0: a
4345     1:
4346     b
4347     0: b
4348     1:
4349     abab
4350     0: abab
4351     1: aba
4352     2: ab
4353     3: a
4354     4:
4355     baba
4356     0: baba
4357     1: bab
4358     2: ba
4359     3: b
4360     4:
4361    
4362     /([^a]*?)*/
4363     b
4364     0: b
4365     1:
4366     bbbb
4367     0: bbbb
4368     1: bbb
4369     2: bb
4370     3: b
4371     4:
4372     aaa
4373     0:
4374    
4375     /([^ab]*?)*/
4376     c
4377     0: c
4378     1:
4379     cccc
4380     0: cccc
4381     1: ccc
4382     2: cc
4383     3: c
4384     4:
4385     baba
4386     0:
4387    
4388     /(?>a*)*/
4389     a
4390     0: a
4391     1:
4392     aaabcde
4393     0: aaa
4394     1:
4395    
4396     /((?>a*))*/
4397     aaaaa
4398     0: aaaaa
4399     1:
4400     aabbaa
4401     0: aa
4402     1:
4403    
4404     /((?>a*?))*/
4405     aaaaa
4406     0: aaaaa
4407     1:
4408     aabbaa
4409     0: aa
4410     1:
4411    
4412     /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
4413     12-sep-98
4414     0: 12-sep-98
4415     12-09-98
4416     0: 12-09-98
4417     *** Failers
4418     No match
4419     sep-12-98
4420     No match
4421    
4422     /(?i:saturday|sunday)/
4423     saturday
4424     0: saturday
4425     sunday
4426     0: sunday
4427     Saturday
4428     0: Saturday
4429     Sunday
4430     0: Sunday
4431     SATURDAY
4432     0: SATURDAY
4433     SUNDAY
4434     0: SUNDAY
4435     SunDay
4436     0: SunDay
4437    
4438     /(a(?i)bc|BB)x/
4439     abcx
4440     0: abcx
4441     aBCx
4442     0: aBCx
4443     bbx
4444     0: bbx
4445     BBx
4446     0: BBx
4447     *** Failers
4448     No match
4449     abcX
4450     No match
4451     aBCX
4452     No match
4453     bbX
4454     No match
4455     BBX
4456     No match
4457    
4458     /^([ab](?i)[cd]|[ef])/
4459     ac
4460     0: ac
4461     aC
4462     0: aC
4463     bD
4464     0: bD
4465     elephant
4466     0: e
4467     Europe
4468     0: E
4469     frog
4470     0: f
4471     France
4472     0: F
4473     *** Failers
4474     No match
4475     Africa
4476     No match
4477    
4478     /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
4479     ab
4480     0: ab
4481     aBd
4482     0: aBd
4483     xy
4484     0: xy
4485     xY
4486     0: xY
4487     zebra
4488     0: z
4489     Zambesi
4490     0: Z
4491     *** Failers
4492     No match
4493     aCD
4494     No match
4495     XY
4496     No match
4497    
4498     /(?<=foo\n)^bar/m
4499     foo\nbar
4500     0: bar
4501     *** Failers
4502     No match
4503     bar
4504     No match
4505     baz\nbar
4506     No match
4507    
4508     /(?<=(?<!foo)bar)baz/
4509     barbaz
4510     0: baz
4511     barbarbaz
4512     0: baz
4513     koobarbaz
4514     0: baz
4515     *** Failers
4516     No match
4517     baz
4518     No match
4519     foobarbaz
4520     No match
4521    
4522     /The following tests are taken from the Perl 5.005 test suite; some of them/
4523     /are compatible with 5.004, but I'd rather not have to sort them out./
4524     No match
4525    
4526     /abc/
4527     abc
4528     0: abc
4529     xabcy
4530     0: abc
4531     ababc
4532     0: abc
4533     *** Failers
4534     No match
4535     xbc
4536     No match
4537     axc
4538     No match
4539     abx
4540     No match
4541    
4542     /ab*c/
4543     abc
4544     0: abc
4545    
4546     /ab*bc/
4547     abc
4548     0: abc
4549     abbc
4550     0: abbc
4551     abbbbc
4552     0: abbbbc
4553    
4554     /.{1}/
4555     abbbbc
4556     0: a
4557    
4558     /.{3,4}/
4559     abbbbc
4560     0: abbb
4561     1: abb
4562    
4563     /ab{0,}bc/
4564     abbbbc
4565     0: abbbbc
4566    
4567     /ab+bc/
4568     abbc
4569     0: abbc
4570     *** Failers
4571     No match
4572     abc
4573     No match
4574     abq
4575     No match
4576    
4577     /ab{1,}bc/
4578    
4579     /ab+bc/
4580     abbbbc
4581     0: abbbbc
4582    
4583     /ab{1,}bc/
4584     abbbbc