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

Contents of /code/trunk/testdata/testoutput7

Parent Directory Parent Directory | Revision Log Revision Log


Revision 435 - (hide annotations) (download)
Sat Sep 5 10:20:44 2009 UTC (5 years ago) by ph10
File size: 115476 byte(s)
Further updates to partial matching.

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 ph10 435 Partial match: foob
985 nigel 77 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 nigel 93 c/x
2739 nigel 77 abc
2740     0: abc
2741    
2742     /ab{1,3}bc/
2743     abbbbc
2744     0: abbbbc
2745     abbbc
2746     0: abbbc
2747     abbc
2748     0: abbc
2749     *** Failers
2750     No match
2751     abc
2752     No match
2753     abbbbbc
2754     No match
2755    
2756     /([^.]*)\.([^:]*):[T ]+(.*)/
2757     track1.title:TBlah blah blah
2758     0: track1.title:TBlah blah blah
2759     1: track1.title:TBlah blah bla
2760     2: track1.title:TBlah blah bl
2761     3: track1.title:TBlah blah b
2762     4: track1.title:TBlah blah
2763     5: track1.title:TBlah blah
2764     6: track1.title:TBlah bla
2765     7: track1.title:TBlah bl
2766     8: track1.title:TBlah b
2767     9: track1.title:TBlah
2768     10: track1.title:TBlah
2769     11: track1.title:TBla
2770     12: track1.title:TBl
2771     13: track1.title:TB
2772     14: track1.title:T
2773    
2774     /([^.]*)\.([^:]*):[T ]+(.*)/i
2775     track1.title:TBlah blah blah
2776     0: track1.title:TBlah blah blah
2777     1: track1.title:TBlah blah bla
2778     2: track1.title:TBlah blah bl
2779     3: track1.title:TBlah blah b
2780     4: track1.title:TBlah blah
2781     5: track1.title:TBlah blah
2782     6: track1.title:TBlah bla
2783     7: track1.title:TBlah bl
2784     8: track1.title:TBlah b
2785     9: track1.title:TBlah
2786     10: track1.title:TBlah
2787     11: track1.title:TBla
2788     12: track1.title:TBl
2789     13: track1.title:TB
2790     14: track1.title:T
2791    
2792     /([^.]*)\.([^:]*):[t ]+(.*)/i
2793     track1.title:TBlah blah blah
2794     0: track1.title:TBlah blah blah
2795     1: track1.title:TBlah blah bla
2796     2: track1.title:TBlah blah bl
2797     3: track1.title:TBlah blah b
2798     4: track1.title:TBlah blah
2799     5: track1.title:TBlah blah
2800     6: track1.title:TBlah bla
2801     7: track1.title:TBlah bl
2802     8: track1.title:TBlah b
2803     9: track1.title:TBlah
2804     10: track1.title:TBlah
2805     11: track1.title:TBla
2806     12: track1.title:TBl
2807     13: track1.title:TB
2808     14: track1.title:T
2809    
2810     /^[W-c]+$/
2811     WXY_^abc
2812     0: WXY_^abc
2813     *** Failers
2814     No match
2815     wxy
2816     No match
2817    
2818     /^[W-c]+$/i
2819     WXY_^abc
2820     0: WXY_^abc
2821     wxy_^ABC
2822     0: wxy_^ABC
2823    
2824     /^[\x3f-\x5F]+$/i
2825     WXY_^abc
2826     0: WXY_^abc
2827     wxy_^ABC
2828     0: wxy_^ABC
2829    
2830     /^abc$/m
2831     abc
2832     0: abc
2833     qqq\nabc
2834     0: abc
2835     abc\nzzz
2836     0: abc
2837     qqq\nabc\nzzz
2838     0: abc
2839    
2840     /^abc$/
2841     abc
2842     0: abc
2843     *** Failers
2844     No match
2845     qqq\nabc
2846     No match
2847     abc\nzzz
2848     No match
2849     qqq\nabc\nzzz
2850     No match
2851    
2852     /\Aabc\Z/m
2853     abc
2854     0: abc
2855     abc\n
2856     0: abc
2857     *** Failers
2858     No match
2859     qqq\nabc
2860     No match
2861     abc\nzzz
2862     No match
2863     qqq\nabc\nzzz
2864     No match
2865    
2866     /\A(.)*\Z/s
2867     abc\ndef
2868     0: abc\x0adef
2869    
2870     /\A(.)*\Z/m
2871     *** Failers
2872     0: *** Failers
2873     abc\ndef
2874     No match
2875    
2876     /(?:b)|(?::+)/
2877     b::c
2878     0: b
2879     c::b
2880     0: ::
2881     1: :
2882    
2883     /[-az]+/
2884     az-
2885     0: az-
2886     1: az
2887     2: a
2888     *** Failers
2889     0: a
2890     b
2891     No match
2892    
2893     /[az-]+/
2894     za-
2895     0: za-
2896     1: za
2897     2: z
2898     *** Failers
2899     0: a
2900     b
2901     No match
2902    
2903     /[a\-z]+/
2904     a-z
2905     0: a-z
2906     1: a-
2907     2: a
2908     *** Failers
2909     0: a
2910     b
2911     No match
2912    
2913     /[a-z]+/
2914     abcdxyz
2915     0: abcdxyz
2916     1: abcdxy
2917     2: abcdx
2918     3: abcd
2919     4: abc
2920     5: ab
2921     6: a
2922    
2923     /[\d-]+/
2924     12-34
2925     0: 12-34
2926     1: 12-3
2927     2: 12-
2928     3: 12
2929     4: 1
2930     *** Failers
2931     No match
2932     aaa
2933     No match
2934    
2935     /[\d-z]+/
2936     12-34z
2937     0: 12-34z
2938     1: 12-34
2939     2: 12-3
2940     3: 12-
2941     4: 12
2942     5: 1
2943     *** Failers
2944     No match
2945     aaa
2946     No match
2947    
2948     /\x5c/
2949     \\
2950     0: \
2951    
2952     /\x20Z/
2953     the Zoo
2954     0: Z
2955     *** Failers
2956     No match
2957     Zulu
2958     No match
2959    
2960     /ab{3cd/
2961     ab{3cd
2962     0: ab{3cd
2963    
2964     /ab{3,cd/
2965     ab{3,cd
2966     0: ab{3,cd
2967    
2968     /ab{3,4a}cd/
2969     ab{3,4a}cd
2970     0: ab{3,4a}cd
2971    
2972     /{4,5a}bc/
2973     {4,5a}bc
2974     0: {4,5a}bc
2975    
2976 nigel 93 /^a.b/<lf>
2977 nigel 77 a\rb
2978     0: a\x0db
2979     *** Failers
2980     No match
2981     a\nb
2982     No match
2983    
2984     /abc$/
2985     abc
2986     0: abc
2987     abc\n
2988     0: abc
2989     *** Failers
2990     No match
2991     abc\ndef
2992     No match
2993    
2994     /(abc)\123/
2995     abc\x53
2996     0: abcS
2997    
2998     /(abc)\223/
2999     abc\x93
3000     0: abc\x93
3001    
3002     /(abc)\323/
3003     abc\xd3
3004     0: abc\xd3
3005    
3006 nigel 91 /(abc)\100/
3007 nigel 77 abc\x40
3008     0: abc@
3009     abc\100
3010     0: abc@
3011    
3012 nigel 91 /(abc)\1000/
3013 nigel 77 abc\x400
3014     0: abc@0
3015     abc\x40\x30
3016     0: abc@0
3017     abc\1000
3018     0: abc@0
3019     abc\100\x30
3020     0: abc@0
3021     abc\100\060
3022     0: abc@0
3023     abc\100\60
3024     0: abc@0
3025    
3026     /abc\81/
3027     abc\081
3028     0: abc\x0081
3029     abc\0\x38\x31
3030     0: abc\x0081
3031    
3032     /abc\91/
3033     abc\091
3034     0: abc\x0091
3035     abc\0\x39\x31
3036     0: abc\x0091
3037    
3038     /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
3039     abcdefghijk\12S
3040     0: abcdefghijk\x0aS
3041    
3042 ph10 178 /ab\idef/
3043     abidef
3044     0: abidef
3045 nigel 77
3046     /a{0}bc/
3047     bc
3048     0: bc
3049    
3050     /(a|(bc)){0,0}?xyz/
3051     xyz
3052     0: xyz
3053    
3054     /abc[\10]de/
3055     abc\010de
3056     0: abc\x08de
3057    
3058     /abc[\1]de/
3059     abc\1de
3060     0: abc\x01de
3061    
3062     /(abc)[\1]de/
3063     abc\1de
3064     0: abc\x01de
3065    
3066     /(?s)a.b/
3067     a\nb
3068     0: a\x0ab
3069    
3070     /^([^a])([^\b])([^c]*)([^d]{3,4})/
3071     baNOTccccd
3072     0: baNOTcccc
3073     1: baNOTccc
3074     2: baNOTcc
3075     3: baNOTc
3076     4: baNOT
3077     baNOTcccd
3078     0: baNOTccc
3079     1: baNOTcc
3080     2: baNOTc
3081     3: baNOT
3082     baNOTccd
3083     0: baNOTcc
3084     1: baNOTc
3085     2: baNOT
3086     bacccd
3087     0: baccc
3088     *** Failers
3089     0: *** Failers
3090     1: *** Failer
3091     2: *** Faile
3092     3: *** Fail
3093     4: *** Fai
3094     5: *** Fa
3095     6: *** F
3096     anything
3097     No match
3098     b\bc
3099     No match
3100     baccd
3101     No match
3102    
3103     /[^a]/
3104     Abc
3105     0: A
3106    
3107     /[^a]/i
3108     Abc
3109     0: b
3110    
3111     /[^a]+/
3112     AAAaAbc
3113     0: AAA
3114     1: AA
3115     2: A
3116    
3117     /[^a]+/i
3118     AAAaAbc
3119     0: bc
3120     1: b
3121    
3122     /[^a]+/
3123     bbb\nccc
3124     0: bbb\x0accc
3125     1: bbb\x0acc
3126     2: bbb\x0ac
3127     3: bbb\x0a
3128     4: bbb
3129     5: bb
3130     6: b
3131    
3132     /[^k]$/
3133     abc
3134     0: c
3135     *** Failers
3136     0: s
3137     abk
3138     No match
3139    
3140     /[^k]{2,3}$/
3141     abc
3142     0: abc
3143     kbc
3144     0: bc
3145     kabc
3146     0: abc
3147     *** Failers
3148     0: ers
3149     abk
3150     No match
3151     akb
3152     No match
3153     akk
3154     No match
3155    
3156     /^\d{8,}\@.+[^k]$/
3157     12345678\@a.b.c.d
3158     0: 12345678@a.b.c.d
3159     123456789\@x.y.z
3160     0: 123456789@x.y.z
3161     *** Failers
3162     No match
3163     12345678\@x.y.uk
3164     No match
3165     1234567\@a.b.c.d
3166     No match
3167    
3168     /[^a]/
3169     aaaabcd
3170     0: b
3171     aaAabcd
3172     0: A
3173    
3174     /[^a]/i
3175     aaaabcd
3176     0: b
3177     aaAabcd
3178     0: b
3179    
3180     /[^az]/
3181     aaaabcd
3182     0: b
3183     aaAabcd
3184     0: A
3185    
3186     /[^az]/i
3187     aaaabcd
3188     0: b
3189     aaAabcd
3190     0: b
3191    
3192     /\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/
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     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
3195    
3196     /P[^*]TAIRE[^*]{1,6}?LL/
3197     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
3198     0: PSTAIREISLL
3199    
3200     /P[^*]TAIRE[^*]{1,}?LL/
3201     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
3202     0: PSTAIREISLL
3203    
3204     /(\.\d\d[1-9]?)\d+/
3205     1.230003938
3206     0: .230003938
3207     1: .23000393
3208     2: .2300039
3209     3: .230003
3210     4: .23000
3211     5: .2300
3212     6: .230
3213     1.875000282
3214     0: .875000282
3215     1: .87500028
3216     2: .8750002
3217     3: .875000
3218     4: .87500
3219     5: .8750
3220     6: .875
3221     1.235
3222     0: .235
3223    
3224     /(\.\d\d((?=0)|\d(?=\d)))/
3225     1.230003938
3226     0: .230
3227     1: .23
3228     1.875000282
3229     0: .875
3230     *** Failers
3231     No match
3232     1.235
3233     No match
3234    
3235     /a(?)b/
3236     ab
3237     0: ab
3238    
3239     /\b(foo)\s+(\w+)/i
3240     Food is on the foo table
3241     0: foo table
3242     1: foo tabl
3243     2: foo tab
3244     3: foo ta
3245     4: foo t
3246    
3247     /foo(.*)bar/
3248     The food is under the bar in the barn.
3249     0: food is under the bar in the bar
3250     1: food is under the bar
3251    
3252     /foo(.*?)bar/
3253     The food is under the bar in the barn.
3254     0: food is under the bar in the bar
3255     1: food is under the bar
3256    
3257     /(.*)(\d*)/
3258     I have 2 numbers: 53147
3259     Matched, but too many subsidiary matches
3260     0: I have 2 numbers: 53147
3261     1: I have 2 numbers: 5314
3262     2: I have 2 numbers: 531
3263     3: I have 2 numbers: 53
3264     4: I have 2 numbers: 5
3265     5: I have 2 numbers:
3266     6: I have 2 numbers:
3267     7: I have 2 numbers
3268     8: I have 2 number
3269     9: I have 2 numbe
3270     10: I have 2 numb
3271     11: I have 2 num
3272     12: I have 2 nu
3273     13: I have 2 n
3274     14: I have 2
3275     15: I have 2
3276     16: I have
3277     17: I have
3278     18: I hav
3279     19: I ha
3280     20: I h
3281     21: I
3282    
3283     /(.*)(\d+)/
3284     I have 2 numbers: 53147
3285     0: I have 2 numbers: 53147
3286     1: I have 2 numbers: 5314
3287     2: I have 2 numbers: 531
3288     3: I have 2 numbers: 53
3289     4: I have 2 numbers: 5
3290     5: I have 2
3291    
3292     /(.*?)(\d*)/
3293     I have 2 numbers: 53147
3294     Matched, but too many subsidiary matches
3295     0: I have 2 numbers: 53147
3296     1: I have 2 numbers: 5314
3297     2: I have 2 numbers: 531
3298     3: I have 2 numbers: 53
3299     4: I have 2 numbers: 5
3300     5: I have 2 numbers:
3301     6: I have 2 numbers:
3302     7: I have 2 numbers
3303     8: I have 2 number
3304     9: I have 2 numbe
3305     10: I have 2 numb
3306     11: I have 2 num
3307     12: I have 2 nu
3308     13: I have 2 n
3309     14: I have 2
3310     15: I have 2
3311     16: I have
3312     17: I have
3313     18: I hav
3314     19: I ha
3315     20: I h
3316     21: I
3317    
3318     /(.*?)(\d+)/
3319     I have 2 numbers: 53147
3320     0: I have 2 numbers: 53147
3321     1: I have 2 numbers: 5314
3322     2: I have 2 numbers: 531
3323     3: I have 2 numbers: 53
3324     4: I have 2 numbers: 5
3325     5: I have 2
3326    
3327     /(.*)(\d+)$/
3328     I have 2 numbers: 53147
3329     0: I have 2 numbers: 53147
3330    
3331     /(.*?)(\d+)$/
3332     I have 2 numbers: 53147
3333     0: I have 2 numbers: 53147
3334    
3335     /(.*)\b(\d+)$/
3336     I have 2 numbers: 53147
3337     0: I have 2 numbers: 53147
3338    
3339     /(.*\D)(\d+)$/
3340     I have 2 numbers: 53147
3341     0: I have 2 numbers: 53147
3342    
3343     /^\D*(?!123)/
3344     ABC123
3345     0: AB
3346     1: A
3347     2:
3348    
3349     /^(\D*)(?=\d)(?!123)/
3350     ABC445
3351     0: ABC
3352     *** Failers
3353     No match
3354     ABC123
3355     No match
3356    
3357     /^[W-]46]/
3358     W46]789
3359     0: W46]
3360     -46]789
3361     0: -46]
3362     *** Failers
3363     No match
3364     Wall
3365     No match
3366     Zebra
3367     No match
3368     42
3369     No match
3370     [abcd]
3371     No match
3372     ]abcd[
3373     No match
3374    
3375     /^[W-\]46]/
3376     W46]789
3377     0: W
3378     Wall
3379     0: W
3380     Zebra
3381     0: Z
3382     Xylophone
3383     0: X
3384     42
3385     0: 4
3386     [abcd]
3387     0: [
3388     ]abcd[
3389     0: ]
3390     \\backslash
3391     0: \
3392     *** Failers
3393     No match
3394     -46]789
3395     No match
3396     well
3397     No match
3398    
3399     /\d\d\/\d\d\/\d\d\d\d/
3400     01/01/2000
3401     0: 01/01/2000
3402    
3403     /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
3404     word cat dog elephant mussel cow horse canary baboon snake shark otherword
3405     0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
3406     word cat dog elephant mussel cow horse canary baboon snake shark
3407     No match
3408    
3409     /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
3410     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
3411     No match
3412    
3413     /^(a){0,0}/
3414     bcd
3415     0:
3416     abc
3417     0:
3418     aab
3419     0:
3420    
3421     /^(a){0,1}/
3422     bcd
3423     0:
3424     abc
3425     0: a
3426     1:
3427     aab
3428     0: a
3429     1:
3430    
3431     /^(a){0,2}/
3432     bcd
3433     0:
3434     abc
3435     0: a
3436     1:
3437     aab
3438     0: aa
3439     1: a
3440     2:
3441    
3442     /^(a){0,3}/
3443     bcd
3444     0:
3445     abc
3446     0: a
3447     1:
3448     aab
3449     0: aa
3450     1: a
3451     2:
3452     aaa
3453     0: aaa
3454     1: aa
3455     2: a
3456     3:
3457    
3458     /^(a){0,}/
3459     bcd
3460     0:
3461     abc
3462     0: a
3463     1:
3464     aab
3465     0: aa
3466     1: a
3467     2:
3468     aaa
3469     0: aaa
3470     1: aa
3471     2: a
3472     3:
3473     aaaaaaaa
3474     0: aaaaaaaa
3475     1: aaaaaaa
3476     2: aaaaaa
3477     3: aaaaa
3478     4: aaaa
3479     5: aaa
3480     6: aa
3481     7: a
3482     8:
3483    
3484     /^(a){1,1}/
3485     bcd
3486     No match
3487     abc
3488     0: a
3489     aab
3490     0: a
3491    
3492     /^(a){1,2}/
3493     bcd
3494     No match
3495     abc
3496     0: a
3497     aab
3498     0: aa
3499     1: a
3500    
3501     /^(a){1,3}/
3502     bcd
3503     No match
3504     abc
3505     0: a
3506     aab
3507     0: aa
3508     1: a
3509     aaa
3510     0: aaa
3511     1: aa
3512     2: a
3513    
3514     /^(a){1,}/
3515     bcd
3516     No match
3517     abc
3518     0: a
3519     aab
3520     0: aa
3521     1: a
3522     aaa
3523     0: aaa
3524     1: aa
3525     2: a
3526     aaaaaaaa
3527     0: aaaaaaaa
3528     1: aaaaaaa
3529     2: aaaaaa
3530     3: aaaaa
3531     4: aaaa
3532     5: aaa
3533     6: aa
3534     7: a
3535    
3536     /.*\.gif/
3537     borfle\nbib.gif\nno
3538     0: bib.gif
3539    
3540     /.{0,}\.gif/
3541     borfle\nbib.gif\nno
3542     0: bib.gif
3543    
3544     /.*\.gif/m
3545     borfle\nbib.gif\nno
3546     0: bib.gif
3547    
3548     /.*\.gif/s
3549     borfle\nbib.gif\nno
3550     0: borfle\x0abib.gif
3551    
3552     /.*\.gif/ms
3553     borfle\nbib.gif\nno
3554     0: borfle\x0abib.gif
3555    
3556     /.*$/
3557     borfle\nbib.gif\nno
3558     0: no
3559    
3560     /.*$/m
3561     borfle\nbib.gif\nno
3562     0: borfle
3563    
3564     /.*$/s
3565     borfle\nbib.gif\nno
3566     0: borfle\x0abib.gif\x0ano
3567    
3568     /.*$/ms
3569     borfle\nbib.gif\nno
3570     0: borfle\x0abib.gif\x0ano
3571     1: borfle\x0abib.gif
3572     2: borfle
3573    
3574     /.*$/
3575     borfle\nbib.gif\nno\n
3576     0: no
3577    
3578     /.*$/m
3579     borfle\nbib.gif\nno\n
3580     0: borfle
3581    
3582     /.*$/s
3583     borfle\nbib.gif\nno\n
3584     0: borfle\x0abib.gif\x0ano\x0a
3585     1: borfle\x0abib.gif\x0ano
3586    
3587     /.*$/ms
3588     borfle\nbib.gif\nno\n
3589     0: borfle\x0abib.gif\x0ano\x0a
3590     1: borfle\x0abib.gif\x0ano
3591     2: borfle\x0abib.gif
3592     3: borfle
3593    
3594     /(.*X|^B)/
3595     abcde\n1234Xyz
3596     0: 1234X
3597     BarFoo
3598     0: B
3599     *** Failers
3600     No match
3601     abcde\nBar
3602     No match
3603    
3604     /(.*X|^B)/m
3605     abcde\n1234Xyz
3606     0: 1234X
3607     BarFoo
3608     0: B
3609     abcde\nBar
3610     0: B
3611    
3612     /(.*X|^B)/s
3613     abcde\n1234Xyz
3614     0: abcde\x0a1234X
3615     BarFoo
3616     0: B
3617     *** Failers
3618     No match
3619     abcde\nBar
3620     No match
3621    
3622     /(.*X|^B)/ms
3623     abcde\n1234Xyz
3624     0: abcde\x0a1234X
3625     BarFoo
3626     0: B
3627     abcde\nBar
3628     0: B
3629    
3630     /(?s)(.*X|^B)/
3631     abcde\n1234Xyz
3632     0: abcde\x0a1234X
3633     BarFoo
3634     0: B
3635     *** Failers
3636     No match
3637     abcde\nBar
3638     No match
3639    
3640     /(?s:.*X|^B)/
3641     abcde\n1234Xyz
3642     0: abcde\x0a1234X
3643     BarFoo
3644     0: B
3645     *** Failers
3646     No match
3647     abcde\nBar
3648     No match
3649    
3650     /^.*B/
3651     **** Failers
3652     No match
3653     abc\nB
3654     No match
3655    
3656     /(?s)^.*B/
3657     abc\nB
3658     0: abc\x0aB
3659    
3660     /(?m)^.*B/
3661     abc\nB
3662     0: B
3663    
3664     /(?ms)^.*B/
3665     abc\nB
3666     0: abc\x0aB
3667    
3668     /(?ms)^B/
3669     abc\nB
3670     0: B
3671    
3672     /(?s)B$/
3673     B\n
3674     0: B
3675    
3676     /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
3677     123456654321
3678     0: 123456654321
3679    
3680     /^\d\d\d\d\d\d\d\d\d\d\d\d/
3681     123456654321
3682     0: 123456654321
3683    
3684     /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
3685     123456654321
3686     0: 123456654321
3687    
3688     /^[abc]{12}/
3689     abcabcabcabc
3690     0: abcabcabcabc
3691    
3692     /^[a-c]{12}/
3693     abcabcabcabc
3694     0: abcabcabcabc
3695    
3696     /^(a|b|c){12}/
3697     abcabcabcabc
3698     0: abcabcabcabc
3699    
3700     /^[abcdefghijklmnopqrstuvwxy0123456789]/
3701     n
3702     0: n
3703     *** Failers
3704     No match
3705     z
3706     No match
3707    
3708     /abcde{0,0}/
3709     abcd
3710     0: abcd
3711     *** Failers
3712     No match
3713     abce
3714     No match
3715    
3716     /ab[cd]{0,0}e/
3717     abe
3718     0: abe
3719     *** Failers
3720     No match
3721     abcde
3722     No match
3723    
3724     /ab(c){0,0}d/
3725     abd
3726     0: abd
3727     *** Failers
3728     No match
3729     abcd
3730     No match
3731    
3732     /a(b*)/
3733     a
3734     0: a
3735     ab
3736     0: ab
3737     1: a
3738     abbbb
3739     0: abbbb
3740     1: abbb
3741     2: abb
3742     3: ab
3743     4: a
3744     *** Failers
3745     0: a
3746     bbbbb
3747     No match
3748    
3749     /ab\d{0}e/
3750     abe
3751     0: abe
3752     *** Failers
3753     No match
3754     ab1e
3755     No match
3756    
3757     /"([^\\"]+|\\.)*"/
3758     the \"quick\" brown fox
3759     0: "quick"
3760     \"the \\\"quick\\\" brown fox\"
3761     0: "the \"quick\" brown fox"
3762    
3763     /.*?/g+
3764     abc
3765     0: abc
3766     0+
3767     1: ab
3768     2: a
3769     3:
3770     0:
3771     0+
3772    
3773     /\b/g+
3774     abc
3775     0:
3776     0+ abc
3777     0:
3778     0+
3779    
3780     /\b/+g
3781     abc
3782     0:
3783     0+ abc
3784     0:
3785     0+
3786    
3787     //g
3788     abc
3789     0:
3790     0:
3791     0:
3792     0:
3793    
3794     /<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
3795     <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>
3796     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>
3797    
3798     /a[^a]b/
3799     acb
3800     0: acb
3801     a\nb
3802     0: a\x0ab
3803    
3804     /a.b/
3805     acb
3806     0: acb
3807     *** Failers
3808     No match
3809     a\nb
3810     No match
3811    
3812     /a[^a]b/s
3813     acb
3814     0: acb
3815     a\nb
3816     0: a\x0ab
3817    
3818     /a.b/s
3819     acb
3820     0: acb
3821     a\nb
3822     0: a\x0ab
3823    
3824     /^(b+?|a){1,2}?c/
3825     bac
3826     0: bac
3827     bbac
3828     0: bbac
3829     bbbac
3830     0: bbbac
3831     bbbbac
3832     0: bbbbac
3833     bbbbbac
3834     0: bbbbbac
3835    
3836     /^(b+|a){1,2}?c/
3837     bac
3838     0: bac
3839     bbac
3840     0: bbac
3841     bbbac
3842     0: bbbac
3843     bbbbac
3844     0: bbbbac
3845     bbbbbac
3846     0: bbbbbac
3847    
3848     /(?!\A)x/m
3849     x\nb\n
3850     No match
3851     a\bx\n
3852     0: x
3853    
3854     /\x0{ab}/
3855     \0{ab}
3856     0: \x00{ab}
3857    
3858     /(A|B)*?CD/
3859     CD
3860     0: CD
3861    
3862     /(A|B)*CD/
3863     CD
3864     0: CD
3865    
3866     /(?<!bar)foo/
3867     foo
3868     0: foo
3869     catfood
3870     0: foo
3871     arfootle
3872     0: foo
3873     rfoosh
3874     0: foo
3875     *** Failers
3876     No match
3877     barfoo
3878     No match
3879     towbarfoo
3880     No match
3881    
3882     /\w{3}(?<!bar)foo/
3883     catfood
3884     0: catfoo
3885     *** Failers
3886     No match
3887     foo
3888     No match
3889     barfoo
3890     No match
3891     towbarfoo
3892     No match
3893    
3894     /(?<=(foo)a)bar/
3895     fooabar
3896     0: bar
3897     *** Failers
3898     No match
3899     bar
3900     No match
3901     foobbar
3902     No match
3903    
3904     /\Aabc\z/m
3905     abc
3906     0: abc
3907     *** Failers
3908     No match
3909     abc\n
3910     No match
3911     qqq\nabc
3912     No match
3913     abc\nzzz
3914     No match
3915     qqq\nabc\nzzz
3916     No match
3917    
3918     "(?>.*/)foo"
3919     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
3920     No match
3921    
3922     "(?>.*/)foo"
3923     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
3924     0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
3925    
3926     /(?>(\.\d\d[1-9]?))\d+/
3927     1.230003938
3928     0: .230003938
3929     1: .23000393
3930     2: .2300039
3931     3: .230003
3932     4: .23000
3933     5: .2300
3934     6: .230
3935     1.875000282
3936     0: .875000282
3937     1: .87500028
3938     2: .8750002
3939     3: .875000
3940     4: .87500
3941     5: .8750
3942     *** Failers
3943     No match
3944     1.235
3945     No match
3946    
3947     /^((?>\w+)|(?>\s+))*$/
3948     now is the time for all good men to come to the aid of the party
3949     0: now is the time for all good men to come to the aid of the party
3950     *** Failers
3951     No match
3952     this is not a line with only words and spaces!
3953     No match
3954    
3955     /(\d+)(\w)/
3956     12345a
3957     0: 12345a
3958     1: 12345
3959     2: 1234
3960     3: 123
3961     4: 12
3962     12345+
3963     0: 12345
3964     1: 1234
3965     2: 123
3966     3: 12
3967    
3968     /((?>\d+))(\w)/
3969     12345a
3970     0: 12345a
3971     *** Failers
3972     No match
3973     12345+
3974     No match
3975    
3976     /(?>a+)b/
3977     aaab
3978     0: aaab
3979    
3980     /((?>a+)b)/
3981     aaab
3982     0: aaab
3983    
3984     /(?>(a+))b/
3985     aaab
3986     0: aaab
3987    
3988     /(?>b)+/
3989     aaabbbccc
3990     0: bbb
3991     1: bb
3992     2: b
3993    
3994     /(?>a+|b+|c+)*c/
3995     aaabbbbccccd
3996     0: aaabbbbcccc
3997     1: aaabbbbc
3998    
3999     /(a+|b+|c+)*c/
4000     aaabbbbccccd
4001     0: aaabbbbcccc
4002     1: aaabbbbccc
4003     2: aaabbbbcc
4004     3: aaabbbbc
4005    
4006     /((?>[^()]+)|\([^()]*\))+/
4007     ((abc(ade)ufh()()x
4008     0: abc(ade)ufh()()x
4009     1: abc(ade)ufh()()
4010     2: abc(ade)ufh()
4011     3: abc(ade)ufh
4012     4: abc(ade)
4013     5: abc
4014    
4015     /\(((?>[^()]+)|\([^()]+\))+\)/
4016     (abc)
4017     0: (abc)
4018     (abc(def)xyz)
4019     0: (abc(def)xyz)
4020     *** Failers
4021     No match
4022     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
4023     No match
4024    
4025     /a(?-i)b/i
4026     ab
4027     0: ab
4028     Ab
4029     0: Ab
4030     *** Failers
4031     No match
4032     aB
4033     No match
4034     AB
4035     No match
4036    
4037     /(a (?x)b c)d e/
4038     a bcd e
4039     0: a bcd e
4040     *** Failers
4041     No match
4042     a b cd e
4043     No match
4044     abcd e
4045     No match
4046     a bcde
4047     No match
4048    
4049     /(a b(?x)c d (?-x)e f)/
4050     a bcde f
4051     0: a bcde f
4052     *** Failers
4053     No match
4054     abcdef
4055     No match
4056    
4057     /(a(?i)b)c/
4058     abc
4059     0: abc
4060     aBc
4061     0: aBc
4062     *** Failers
4063     No match
4064     abC
4065     No match
4066     aBC
4067     No match
4068     Abc
4069     No match
4070     ABc
4071     No match
4072     ABC
4073     No match
4074     AbC
4075     No match
4076    
4077     /a(?i:b)c/
4078     abc
4079     0: abc
4080     aBc
4081     0: aBc
4082     *** Failers
4083     No match
4084     ABC
4085     No match
4086     abC
4087     No match
4088     aBC
4089     No match
4090    
4091     /a(?i:b)*c/
4092     aBc
4093     0: aBc
4094     aBBc
4095     0: aBBc
4096     *** Failers
4097     No match
4098     aBC
4099     No match
4100     aBBC
4101     No match
4102    
4103     /a(?=b(?i)c)\w\wd/
4104     abcd
4105     0: abcd
4106     abCd
4107     0: abCd
4108     *** Failers
4109     No match
4110     aBCd
4111     No match
4112     abcD
4113     No match
4114    
4115     /(?s-i:more.*than).*million/i
4116     more than million
4117     0: more than million
4118     more than MILLION
4119     0: more than MILLION
4120     more \n than Million
4121     0: more \x0a than Million
4122     *** Failers
4123     No match
4124     MORE THAN MILLION
4125     No match
4126     more \n than \n million
4127     No match
4128    
4129     /(?:(?s-i)more.*than).*million/i
4130     more than million
4131     0: more than million
4132     more than MILLION
4133     0: more than MILLION
4134     more \n than Million
4135     0: more \x0a than Million
4136     *** Failers
4137     No match
4138     MORE THAN MILLION
4139     No match
4140     more \n than \n million
4141     No match
4142    
4143     /(?>a(?i)b+)+c/
4144     abc
4145     0: abc
4146     aBbc
4147     0: aBbc
4148     aBBc
4149     0: aBBc
4150     *** Failers
4151     No match
4152     Abc
4153     No match
4154     abAb
4155     No match
4156     abbC
4157     No match
4158    
4159     /(?=a(?i)b)\w\wc/
4160     abc
4161     0: abc
4162     aBc
4163     0: aBc
4164     *** Failers
4165     No match
4166     Ab
4167     No match
4168     abC
4169     No match
4170     aBC
4171     No match
4172    
4173     /(?<=a(?i)b)(\w\w)c/
4174     abxxc
4175     0: xxc
4176     aBxxc
4177     0: xxc
4178     *** Failers
4179     No match
4180     Abxxc
4181     No match
4182     ABxxc
4183     No match
4184     abxxC
4185     No match
4186    
4187     /^(?(?=abc)\w{3}:|\d\d)$/
4188     abc:
4189     0: abc:
4190     12
4191     0: 12
4192     *** Failers
4193     No match
4194     123
4195     No match
4196     xyz
4197     No match
4198    
4199     /^(?(?!abc)\d\d|\w{3}:)$/
4200     abc:
4201     0: abc:
4202     12
4203     0: 12
4204     *** Failers
4205     No match
4206     123
4207     No match
4208     xyz
4209     No match
4210    
4211     /(?(?<=foo)bar|cat)/
4212     foobar
4213     0: bar
4214     cat
4215     0: cat
4216     fcat
4217     0: cat
4218     focat
4219     0: cat
4220     *** Failers
4221     No match
4222     foocat
4223     No match
4224    
4225     /(?(?<!foo)cat|bar)/
4226     foobar
4227     0: bar
4228     cat
4229     0: cat
4230     fcat
4231     0: cat
4232     focat
4233     0: cat
4234     *** Failers
4235     No match
4236     foocat
4237     No match
4238    
4239     /(?>a*)*/
4240     a
4241     0: a
4242     1:
4243     aa
4244     0: aa
4245     1:
4246     aaaa
4247     0: aaaa
4248     1:
4249    
4250     /(abc|)+/
4251     abc
4252     0: abc
4253     1:
4254     abcabc
4255     0: abcabc
4256     1: abc
4257     2:
4258     abcabcabc
4259     0: abcabcabc
4260     1: abcabc
4261     2: abc
4262     3:
4263     xyz
4264     0:
4265    
4266     /([a]*)*/
4267     a
4268     0: a
4269     1:
4270     aaaaa
4271     0: aaaaa
4272     1: aaaa
4273     2: aaa
4274     3: aa
4275     4: a
4276     5:
4277    
4278     /([ab]*)*/
4279     a
4280     0: a
4281     1:
4282     b
4283     0: b
4284     1:
4285     ababab
4286     0: ababab
4287     1: ababa
4288     2: abab
4289     3: aba
4290     4: ab
4291     5: a
4292     6:
4293     aaaabcde
4294     0: aaaab
4295     1: aaaa
4296     2: aaa
4297     3: aa
4298     4: a
4299     5:
4300     bbbb
4301     0: bbbb
4302     1: bbb
4303     2: bb
4304     3: b
4305     4:
4306    
4307     /([^a]*)*/
4308     b
4309     0: b
4310     1:
4311     bbbb
4312     0: bbbb
4313     1: bbb
4314     2: bb
4315     3: b
4316     4:
4317     aaa
4318     0:
4319    
4320     /([^ab]*)*/
4321     cccc
4322     0: cccc
4323     1: ccc
4324     2: cc
4325     3: c
4326     4:
4327     abab
4328     0:
4329    
4330     /([a]*?)*/
4331     a
4332     0: a
4333     1:
4334     aaaa
4335     0: aaaa
4336     1: aaa
4337     2: aa
4338     3: a
4339     4:
4340    
4341     /([ab]*?)*/
4342     a
4343     0: a
4344     1:
4345     b
4346     0: b
4347     1:
4348     abab
4349     0: abab
4350     1: aba
4351     2: ab
4352     3: a
4353     4:
4354     baba
4355     0: baba
4356     1: bab
4357     2: ba
4358     3: b
4359     4:
4360    
4361     /([^a]*?)*/
4362     b
4363     0: b
4364     1:
4365     bbbb
4366     0: bbbb
4367     1: bbb
4368     2: bb
4369     3: b
4370     4:
4371     aaa
4372     0:
4373    
4374     /([^ab]*?)*/
4375     c
4376     0: c
4377     1:
4378     cccc
4379     0: cccc
4380     1: ccc
4381     2: cc
4382     3: c
4383     4:
4384     baba
4385     0:
4386    
4387     /(?>a*)*/
4388     a
4389     0: a
4390     1:
4391     aaabcde
4392     0: aaa
4393     1:
4394    
4395     /((?>a*))*/
4396     aaaaa
4397     0: aaaaa
4398     1:
4399     aabbaa
4400     0: aa
4401     1:
4402    
4403     /((?>a*?))*/
4404     aaaaa
4405     0: aaaaa
4406     1:
4407     aabbaa
4408     0: aa
4409     1:
4410    
4411     /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
4412     12-sep-98
4413     0: 12-sep-98
4414     12-09-98
4415     0: 12-09-98
4416     *** Failers
4417     No match
4418     sep-12-98
4419     No match
4420    
4421     /(?i:saturday|sunday)/
4422     saturday
4423     0: saturday
4424     sunday
4425     0: sunday
4426     Saturday
4427     0: Saturday
4428     Sunday
4429     0: Sunday
4430     SATURDAY
4431     0: SATURDAY
4432     SUNDAY
4433     0: SUNDAY
4434     SunDay
4435     0: SunDay
4436    
4437     /(a(?i)bc|BB)x/
4438     abcx
4439     0: abcx
4440     aBCx
4441     0: aBCx
4442     bbx
4443     0: bbx
4444     BBx
4445     0: BBx
4446     *** Failers
4447     No match
4448     abcX
4449     No match
4450     aBCX
4451     No match
4452     bbX
4453     No match
4454     BBX
4455     No match
4456    
4457     /^([ab](?i)[cd]|[ef])/
4458     ac
4459     0: ac
4460     aC
4461     0: aC
4462     bD
4463     0: bD
4464     elephant
4465     0: e
4466     Europe
4467     0: E
4468     frog
4469     0: f
4470     France
4471     0: F
4472     *** Failers
4473     No match
4474     Africa
4475     No match
4476    
4477     /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
4478     ab
4479     0: ab
4480     aBd
4481     0: aBd
4482     xy
4483     0: xy
4484     xY
4485     0: xY
4486     zebra
4487     0: z
4488     Zambesi
4489     0: Z
4490     *** Failers
4491     No match
4492     aCD
4493     No match
4494     XY
4495     No match
4496    
4497     /(?<=foo\n)^bar/m
4498     foo\nbar
4499     0: bar
4500     *** Failers
4501     No match
4502     bar
4503     No match
4504     baz\nbar
4505     No match
4506    
4507     /(?<=(?<!foo)bar)baz/
4508     barbaz
4509     0: baz
4510     barbarbaz
4511     0: baz
4512     koobarbaz
4513     0: baz
4514     *** Failers
4515     No match
4516     baz
4517     No match
4518     foobarbaz
4519     No match
4520    
4521     /The following tests are taken from the Perl 5.005 test suite; some of them/
4522     /are compatible with 5.004, but I'd rather not have to sort them out./
4523     No match
4524    
4525     /abc/
4526     abc
4527     0: abc
4528     xabcy
4529     0: abc
4530     ababc
4531     0: abc
4532     *** Failers
4533     No match
4534     xbc
4535     No match
4536     axc
4537     No match
4538     abx
4539     No match
4540    
4541     /ab*c/
4542     abc
4543     0: abc
4544    
4545     /ab*bc/
4546     abc
4547     0: abc
4548     abbc
4549     0: abbc
4550     abbbbc
4551     0: abbbbc
4552    
4553     /.{1}/
4554     abbbbc
4555     0: a
4556    
4557     /.{3,4}/
4558     abbbbc
4559     0: abbb
4560     1: abb
4561    
4562     /ab{0,}bc/
4563     abbbbc
4564     0: abbbbc
4565