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

Contents of /code/trunk/testdata/testoutput1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 87 - (hide annotations) (download)
Sat Feb 24 21:41:21 2007 UTC (6 years, 2 months ago) by nigel
File size: 98413 byte(s)
Load pcre-6.5 into code/trunk.

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