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

Contents of /code/trunk/testdata/testoutput8

Parent Directory Parent Directory | Revision Log Revision Log


Revision 979 - (hide annotations) (download)
Sun Jun 17 19:08:41 2012 UTC (11 months ago) by ph10
File size: 122984 byte(s)
Fix DFA bug (3 cases) when UTF code was being obeyed in non-UTF mode.

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