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

Contents of /code/trunk/testdata/testoutput8

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1478 - (hide annotations) (download)
Tue May 27 13:18:31 2014 UTC (3 months, 4 weeks ago) by ph10
File size: 120403 byte(s)
Fix empty-matching possessive zero-repeat groups bug.

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