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

Contents of /code/trunk/testdata/testoutput1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 206 - (hide annotations) (download)
Fri Aug 3 14:53:04 2007 UTC (6 years, 11 months ago) by ph10
File size: 101571 byte(s)
Fix loop for null-matching condition nested in an outer unlimited repeat.

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 nigel 93 c/x
1821 nigel 41 abc
1822     0: abc
1823    
1824     /^(a|)\1*b/
1825     ab
1826     0: ab
1827     1: a
1828     aaaab
1829     0: aaaab
1830     1: a
1831     b
1832     0: b
1833     1:
1834     *** Failers
1835     No match
1836     acb
1837     No match
1838    
1839     /^(a|)\1+b/
1840     aab
1841     0: aab
1842     1: a
1843     aaaab
1844     0: aaaab
1845     1: a
1846     b
1847     0: b
1848     1:
1849     *** Failers
1850     No match
1851     ab
1852     No match
1853    
1854     /^(a|)\1?b/
1855     ab
1856     0: ab
1857     1: a
1858     aab
1859     0: aab
1860     1: a
1861     b
1862     0: b
1863     1:
1864     *** Failers
1865     No match
1866     acb
1867     No match
1868    
1869     /^(a|)\1{2}b/
1870     aaab
1871     0: aaab
1872     1: a
1873     b
1874     0: b
1875     1:
1876     *** Failers
1877     No match
1878     ab
1879     No match
1880     aab
1881     No match
1882     aaaab
1883     No match
1884    
1885     /^(a|)\1{2,3}b/
1886     aaab
1887     0: aaab
1888     1: a
1889     aaaab
1890     0: aaaab
1891     1: a
1892     b
1893     0: b
1894     1:
1895     *** Failers
1896     No match
1897     ab
1898     No match
1899     aab
1900     No match
1901     aaaaab
1902     No match
1903    
1904     /ab{1,3}bc/
1905     abbbbc
1906     0: abbbbc
1907     abbbc
1908     0: abbbc
1909     abbc
1910     0: abbc
1911     *** Failers
1912     No match
1913     abc
1914     No match
1915     abbbbbc
1916     No match
1917    
1918     /([^.]*)\.([^:]*):[T ]+(.*)/
1919     track1.title:TBlah blah blah
1920     0: track1.title:TBlah blah blah
1921     1: track1
1922     2: title
1923     3: Blah blah blah
1924    
1925     /([^.]*)\.([^:]*):[T ]+(.*)/i
1926     track1.title:TBlah blah blah
1927     0: track1.title:TBlah blah blah
1928     1: track1
1929     2: title
1930     3: Blah blah blah
1931    
1932     /([^.]*)\.([^:]*):[t ]+(.*)/i
1933     track1.title:TBlah blah blah
1934     0: track1.title:TBlah blah blah
1935     1: track1
1936     2: title
1937     3: Blah blah blah
1938    
1939     /^[W-c]+$/
1940     WXY_^abc
1941     0: WXY_^abc
1942 nigel 63 *** Failers
1943 nigel 41 No match
1944     wxy
1945     No match
1946    
1947     /^[W-c]+$/i
1948     WXY_^abc
1949     0: WXY_^abc
1950     wxy_^ABC
1951     0: wxy_^ABC
1952    
1953     /^[\x3f-\x5F]+$/i
1954     WXY_^abc
1955     0: WXY_^abc
1956     wxy_^ABC
1957     0: wxy_^ABC
1958    
1959     /^abc$/m
1960     abc
1961     0: abc
1962     qqq\nabc
1963     0: abc
1964     abc\nzzz
1965     0: abc
1966     qqq\nabc\nzzz
1967     0: abc
1968    
1969     /^abc$/
1970     abc
1971     0: abc
1972     *** Failers
1973     No match
1974     qqq\nabc
1975     No match
1976     abc\nzzz
1977     No match
1978     qqq\nabc\nzzz
1979     No match
1980    
1981     /\Aabc\Z/m
1982     abc
1983     0: abc
1984     abc\n
1985     0: abc
1986     *** Failers
1987     No match
1988     qqq\nabc
1989     No match
1990     abc\nzzz
1991     No match
1992     qqq\nabc\nzzz
1993     No match
1994    
1995     /\A(.)*\Z/s
1996     abc\ndef
1997     0: abc\x0adef
1998     1: f
1999    
2000     /\A(.)*\Z/m
2001     *** Failers
2002     0: *** Failers
2003     1: s
2004     abc\ndef
2005     No match
2006    
2007     /(?:b)|(?::+)/
2008     b::c
2009     0: b
2010     c::b
2011     0: ::
2012    
2013     /[-az]+/
2014     az-
2015     0: az-
2016     *** Failers
2017     0: a
2018     b
2019     No match
2020    
2021     /[az-]+/
2022     za-
2023     0: za-
2024     *** Failers
2025     0: a
2026     b
2027     No match
2028    
2029     /[a\-z]+/
2030     a-z
2031     0: a-z
2032     *** Failers
2033     0: a
2034     b
2035     No match
2036    
2037     /[a-z]+/
2038     abcdxyz
2039     0: abcdxyz
2040    
2041     /[\d-]+/
2042     12-34
2043     0: 12-34
2044     *** Failers
2045     No match
2046     aaa
2047     No match
2048    
2049     /[\d-z]+/
2050     12-34z
2051     0: 12-34z
2052     *** Failers
2053     No match
2054     aaa
2055     No match
2056    
2057     /\x5c/
2058     \\
2059     0: \
2060    
2061     /\x20Z/
2062     the Zoo
2063     0: Z
2064     *** Failers
2065     No match
2066     Zulu
2067     No match
2068    
2069     /(abc)\1/i
2070     abcabc
2071     0: abcabc
2072     1: abc
2073     ABCabc
2074     0: ABCabc
2075     1: ABC
2076     abcABC
2077     0: abcABC
2078     1: abc
2079    
2080     /ab{3cd/
2081     ab{3cd
2082     0: ab{3cd
2083    
2084     /ab{3,cd/
2085     ab{3,cd
2086     0: ab{3,cd
2087    
2088     /ab{3,4a}cd/
2089     ab{3,4a}cd
2090     0: ab{3,4a}cd
2091    
2092     /{4,5a}bc/
2093     {4,5a}bc
2094     0: {4,5a}bc
2095    
2096     /abc$/
2097     abc
2098     0: abc
2099     abc\n
2100     0: abc
2101     *** Failers
2102     No match
2103     abc\ndef
2104     No match
2105    
2106     /(abc)\123/
2107     abc\x53
2108     0: abcS
2109     1: abc
2110    
2111     /(abc)\223/
2112     abc\x93
2113     0: abc\x93
2114     1: abc
2115    
2116     /(abc)\323/
2117     abc\xd3
2118     0: abc\xd3
2119     1: abc
2120    
2121 nigel 91 /(abc)\100/
2122 nigel 41 abc\x40
2123     0: abc@
2124     1: abc
2125     abc\100
2126     0: abc@
2127     1: abc
2128    
2129 nigel 91 /(abc)\1000/
2130 nigel 41 abc\x400
2131     0: abc@0
2132     1: abc
2133     abc\x40\x30
2134     0: abc@0
2135     1: abc
2136     abc\1000
2137     0: abc@0
2138     1: abc
2139     abc\100\x30
2140     0: abc@0
2141     1: abc
2142     abc\100\060
2143     0: abc@0
2144     1: abc
2145     abc\100\60
2146     0: abc@0
2147     1: abc
2148    
2149     /abc\81/
2150     abc\081
2151     0: abc\x0081
2152     abc\0\x38\x31
2153     0: abc\x0081
2154    
2155     /abc\91/
2156     abc\091
2157     0: abc\x0091
2158     abc\0\x39\x31
2159     0: abc\x0091
2160    
2161     /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/
2162     abcdefghijkllS
2163     0: abcdefghijkllS
2164     1: a
2165     2: b
2166     3: c
2167     4: d
2168     5: e
2169     6: f
2170     7: g
2171     8: h
2172     9: i
2173     10: j
2174     11: k
2175     12: l
2176    
2177     /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
2178     abcdefghijk\12S
2179     0: abcdefghijk\x0aS
2180     1: a
2181     2: b
2182     3: c
2183     4: d
2184     5: e
2185     6: f
2186     7: g
2187     8: h
2188     9: i
2189     10: j
2190     11: k
2191    
2192 ph10 178 /ab\idef/
2193     abidef
2194     0: abidef
2195 nigel 41
2196     /a{0}bc/
2197     bc
2198     0: bc
2199    
2200     /(a|(bc)){0,0}?xyz/
2201     xyz
2202     0: xyz
2203    
2204     /abc[\10]de/
2205     abc\010de
2206     0: abc\x08de
2207    
2208     /abc[\1]de/
2209     abc\1de
2210     0: abc\x01de
2211    
2212     /(abc)[\1]de/
2213     abc\1de
2214     0: abc\x01de
2215     1: abc
2216    
2217 nigel 63 /(?s)a.b/
2218 nigel 41 a\nb
2219     0: a\x0ab
2220    
2221     /^([^a])([^\b])([^c]*)([^d]{3,4})/
2222     baNOTccccd
2223     0: baNOTcccc
2224     1: b
2225     2: a
2226     3: NOT
2227     4: cccc
2228     baNOTcccd
2229     0: baNOTccc
2230     1: b
2231     2: a
2232     3: NOT
2233     4: ccc
2234     baNOTccd
2235     0: baNOTcc
2236     1: b
2237     2: a
2238     3: NO
2239     4: Tcc
2240     bacccd
2241     0: baccc
2242     1: b
2243     2: a
2244     3:
2245     4: ccc
2246     *** Failers
2247     0: *** Failers
2248     1: *
2249     2: *
2250     3: * Fail
2251     4: ers
2252     anything
2253     No match
2254     b\bc
2255     No match
2256     baccd
2257     No match
2258    
2259     /[^a]/
2260     Abc
2261     0: A
2262    
2263     /[^a]/i
2264     Abc
2265     0: b
2266    
2267     /[^a]+/
2268     AAAaAbc
2269     0: AAA
2270    
2271     /[^a]+/i
2272     AAAaAbc
2273     0: bc
2274    
2275     /[^a]+/
2276     bbb\nccc
2277     0: bbb\x0accc
2278    
2279     /[^k]$/
2280     abc
2281     0: c
2282     *** Failers
2283     0: s
2284     abk
2285     No match
2286    
2287     /[^k]{2,3}$/
2288     abc
2289     0: abc
2290     kbc
2291     0: bc
2292     kabc
2293     0: abc
2294     *** Failers
2295     0: ers
2296     abk
2297     No match
2298     akb
2299     No match
2300     akk
2301     No match
2302    
2303     /^\d{8,}\@.+[^k]$/
2304     12345678\@a.b.c.d
2305     0: 12345678@a.b.c.d
2306     123456789\@x.y.z
2307     0: 123456789@x.y.z
2308     *** Failers
2309     No match
2310     12345678\@x.y.uk
2311     No match
2312     1234567\@a.b.c.d
2313     No match
2314    
2315     /(a)\1{8,}/
2316     aaaaaaaaa
2317     0: aaaaaaaaa
2318     1: a
2319     aaaaaaaaaa
2320     0: aaaaaaaaaa
2321     1: a
2322     *** Failers
2323     No match
2324     aaaaaaa
2325     No match
2326    
2327     /[^a]/
2328     aaaabcd
2329     0: b
2330     aaAabcd
2331     0: A
2332    
2333     /[^a]/i
2334     aaaabcd
2335     0: b
2336     aaAabcd
2337     0: b
2338    
2339     /[^az]/
2340     aaaabcd
2341     0: b
2342     aaAabcd
2343     0: A
2344    
2345     /[^az]/i
2346     aaaabcd
2347     0: b
2348     aaAabcd
2349     0: b
2350    
2351     /\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/
2352     \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
2353     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
2354    
2355     /P[^*]TAIRE[^*]{1,6}?LL/
2356     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
2357     0: PSTAIREISLL
2358    
2359     /P[^*]TAIRE[^*]{1,}?LL/
2360     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
2361     0: PSTAIREISLL
2362    
2363     /(\.\d\d[1-9]?)\d+/
2364     1.230003938
2365     0: .230003938
2366     1: .23
2367     1.875000282
2368     0: .875000282
2369     1: .875
2370     1.235
2371     0: .235
2372     1: .23
2373    
2374     /(\.\d\d((?=0)|\d(?=\d)))/
2375     1.230003938
2376     0: .23
2377     1: .23
2378     2:
2379     1.875000282
2380     0: .875
2381     1: .875
2382     2: 5
2383     *** Failers
2384     No match
2385     1.235
2386     No match
2387    
2388     /a(?)b/
2389     ab
2390     0: ab
2391    
2392     /\b(foo)\s+(\w+)/i
2393     Food is on the foo table
2394     0: foo table
2395     1: foo
2396     2: table
2397    
2398     /foo(.*)bar/
2399     The food is under the bar in the barn.
2400     0: food is under the bar in the bar
2401     1: d is under the bar in the
2402    
2403     /foo(.*?)bar/
2404     The food is under the bar in the barn.
2405     0: food is under the bar
2406     1: d is under the
2407    
2408     /(.*)(\d*)/
2409     I have 2 numbers: 53147
2410     0: I have 2 numbers: 53147
2411     1: I have 2 numbers: 53147
2412     2:
2413    
2414     /(.*)(\d+)/
2415     I have 2 numbers: 53147
2416     0: I have 2 numbers: 53147
2417     1: I have 2 numbers: 5314
2418     2: 7
2419    
2420     /(.*?)(\d*)/
2421     I have 2 numbers: 53147
2422     0:
2423     1:
2424     2:
2425    
2426     /(.*?)(\d+)/
2427     I have 2 numbers: 53147
2428     0: I have 2
2429     1: I have
2430     2: 2
2431    
2432     /(.*)(\d+)$/
2433     I have 2 numbers: 53147
2434     0: I have 2 numbers: 53147
2435     1: I have 2 numbers: 5314
2436     2: 7
2437    
2438     /(.*?)(\d+)$/
2439     I have 2 numbers: 53147
2440     0: I have 2 numbers: 53147
2441     1: I have 2 numbers:
2442     2: 53147
2443    
2444     /(.*)\b(\d+)$/
2445     I have 2 numbers: 53147
2446     0: I have 2 numbers: 53147
2447     1: I have 2 numbers:
2448     2: 53147
2449    
2450     /(.*\D)(\d+)$/
2451     I have 2 numbers: 53147
2452     0: I have 2 numbers: 53147
2453     1: I have 2 numbers:
2454     2: 53147
2455    
2456     /^\D*(?!123)/
2457     ABC123
2458     0: AB
2459    
2460     /^(\D*)(?=\d)(?!123)/
2461     ABC445
2462     0: ABC
2463     1: ABC
2464     *** Failers
2465     No match
2466     ABC123
2467     No match
2468    
2469     /^[W-]46]/
2470     W46]789
2471     0: W46]
2472     -46]789
2473     0: -46]
2474     *** Failers
2475     No match
2476     Wall
2477     No match
2478     Zebra
2479     No match
2480     42
2481     No match
2482     [abcd]
2483     No match
2484     ]abcd[
2485     No match
2486    
2487     /^[W-\]46]/
2488     W46]789
2489     0: W
2490     Wall
2491     0: W
2492     Zebra
2493     0: Z
2494     Xylophone
2495     0: X
2496     42
2497     0: 4
2498     [abcd]
2499     0: [
2500     ]abcd[
2501     0: ]
2502     \\backslash
2503     0: \
2504     *** Failers
2505     No match
2506     -46]789
2507     No match
2508     well
2509     No match
2510    
2511     /\d\d\/\d\d\/\d\d\d\d/
2512     01/01/2000
2513     0: 01/01/2000
2514    
2515     /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
2516     word cat dog elephant mussel cow horse canary baboon snake shark otherword
2517     0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
2518     word cat dog elephant mussel cow horse canary baboon snake shark
2519     No match
2520    
2521     /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
2522     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
2523     No match
2524    
2525     /^(a){0,0}/
2526     bcd
2527     0:
2528     abc
2529     0:
2530     aab
2531     0:
2532    
2533     /^(a){0,1}/
2534     bcd
2535     0:
2536     abc
2537     0: a
2538     1: a
2539     aab
2540     0: a
2541     1: a
2542    
2543     /^(a){0,2}/
2544     bcd
2545     0:
2546     abc
2547     0: a
2548     1: a
2549     aab
2550     0: aa
2551     1: a
2552    
2553     /^(a){0,3}/
2554     bcd
2555     0:
2556     abc
2557     0: a
2558     1: a
2559     aab
2560     0: aa
2561     1: a
2562     aaa
2563     0: aaa
2564     1: a
2565    
2566     /^(a){0,}/
2567     bcd
2568     0:
2569     abc
2570     0: a
2571     1: a
2572     aab
2573     0: aa
2574     1: a
2575     aaa
2576     0: aaa
2577     1: a
2578     aaaaaaaa
2579     0: aaaaaaaa
2580     1: a
2581    
2582     /^(a){1,1}/
2583     bcd
2584     No match
2585     abc
2586     0: a
2587     1: a
2588     aab
2589     0: a
2590     1: a
2591    
2592     /^(a){1,2}/
2593     bcd
2594     No match
2595     abc
2596     0: a
2597     1: a
2598     aab
2599     0: aa
2600     1: a
2601    
2602     /^(a){1,3}/
2603     bcd
2604     No match
2605     abc
2606     0: a
2607     1: a
2608     aab
2609     0: aa
2610     1: a
2611     aaa
2612     0: aaa
2613     1: a
2614    
2615     /^(a){1,}/
2616     bcd
2617     No match
2618     abc
2619     0: a
2620     1: a
2621     aab
2622     0: aa
2623     1: a
2624     aaa
2625     0: aaa
2626     1: a
2627     aaaaaaaa
2628     0: aaaaaaaa
2629     1: a
2630    
2631     /.*\.gif/
2632     borfle\nbib.gif\nno
2633     0: bib.gif
2634    
2635     /.{0,}\.gif/
2636     borfle\nbib.gif\nno
2637     0: bib.gif
2638    
2639     /.*\.gif/m
2640     borfle\nbib.gif\nno
2641     0: bib.gif
2642    
2643     /.*\.gif/s
2644     borfle\nbib.gif\nno
2645     0: borfle\x0abib.gif
2646    
2647     /.*\.gif/ms
2648     borfle\nbib.gif\nno
2649     0: borfle\x0abib.gif
2650    
2651     /.*$/
2652     borfle\nbib.gif\nno
2653     0: no
2654    
2655     /.*$/m
2656     borfle\nbib.gif\nno
2657     0: borfle
2658    
2659     /.*$/s
2660     borfle\nbib.gif\nno
2661     0: borfle\x0abib.gif\x0ano
2662    
2663     /.*$/ms
2664     borfle\nbib.gif\nno
2665     0: borfle\x0abib.gif\x0ano
2666    
2667     /.*$/
2668     borfle\nbib.gif\nno\n
2669     0: no
2670    
2671     /.*$/m
2672     borfle\nbib.gif\nno\n
2673     0: borfle
2674    
2675     /.*$/s
2676     borfle\nbib.gif\nno\n
2677     0: borfle\x0abib.gif\x0ano\x0a
2678    
2679     /.*$/ms
2680     borfle\nbib.gif\nno\n
2681     0: borfle\x0abib.gif\x0ano\x0a
2682    
2683     /(.*X|^B)/
2684     abcde\n1234Xyz
2685     0: 1234X
2686     1: 1234X
2687     BarFoo
2688     0: B
2689     1: B
2690     *** Failers
2691     No match
2692     abcde\nBar
2693     No match
2694    
2695     /(.*X|^B)/m
2696     abcde\n1234Xyz
2697     0: 1234X
2698     1: 1234X
2699     BarFoo
2700     0: B
2701     1: B
2702     abcde\nBar
2703     0: B
2704     1: B
2705    
2706     /(.*X|^B)/s
2707     abcde\n1234Xyz
2708     0: abcde\x0a1234X
2709     1: abcde\x0a1234X
2710     BarFoo
2711     0: B
2712     1: B
2713     *** Failers
2714     No match
2715     abcde\nBar
2716     No match
2717    
2718     /(.*X|^B)/ms
2719     abcde\n1234Xyz
2720     0: abcde\x0a1234X
2721     1: abcde\x0a1234X
2722     BarFoo
2723     0: B
2724     1: B
2725     abcde\nBar
2726     0: B
2727     1: B
2728    
2729     /(?s)(.*X|^B)/
2730     abcde\n1234Xyz
2731     0: abcde\x0a1234X
2732     1: abcde\x0a1234X
2733     BarFoo
2734     0: B
2735     1: B
2736     *** Failers
2737     No match
2738     abcde\nBar
2739     No match
2740    
2741     /(?s:.*X|^B)/
2742     abcde\n1234Xyz
2743     0: abcde\x0a1234X
2744     BarFoo
2745     0: B
2746     *** Failers
2747     No match
2748     abcde\nBar
2749     No match
2750    
2751     /^.*B/
2752     **** Failers
2753     No match
2754     abc\nB
2755     No match
2756    
2757     /(?s)^.*B/
2758     abc\nB
2759     0: abc\x0aB
2760    
2761     /(?m)^.*B/
2762     abc\nB
2763     0: B
2764    
2765     /(?ms)^.*B/
2766     abc\nB
2767     0: abc\x0aB
2768    
2769     /(?ms)^B/
2770     abc\nB
2771     0: B
2772    
2773     /(?s)B$/
2774     B\n
2775     0: B
2776    
2777     /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
2778     123456654321
2779     0: 123456654321
2780    
2781     /^\d\d\d\d\d\d\d\d\d\d\d\d/
2782     123456654321
2783     0: 123456654321
2784    
2785     /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
2786     123456654321
2787     0: 123456654321
2788    
2789     /^[abc]{12}/
2790     abcabcabcabc
2791     0: abcabcabcabc
2792    
2793     /^[a-c]{12}/
2794     abcabcabcabc
2795     0: abcabcabcabc
2796    
2797     /^(a|b|c){12}/
2798     abcabcabcabc
2799     0: abcabcabcabc
2800     1: c
2801    
2802     /^[abcdefghijklmnopqrstuvwxy0123456789]/
2803     n
2804     0: n
2805     *** Failers
2806     No match
2807     z
2808     No match
2809    
2810     /abcde{0,0}/
2811     abcd
2812     0: abcd
2813     *** Failers
2814     No match
2815     abce
2816     No match
2817    
2818     /ab[cd]{0,0}e/
2819     abe
2820     0: abe
2821     *** Failers
2822     No match
2823     abcde
2824     No match
2825    
2826     /ab(c){0,0}d/
2827     abd
2828     0: abd
2829     *** Failers
2830     No match
2831     abcd
2832     No match
2833    
2834     /a(b*)/
2835     a
2836     0: a
2837     1:
2838     ab
2839     0: ab
2840     1: b
2841     abbbb
2842     0: abbbb
2843     1: bbbb
2844     *** Failers
2845     0: a
2846     1:
2847     bbbbb
2848     No match
2849    
2850     /ab\d{0}e/
2851     abe
2852     0: abe
2853     *** Failers
2854     No match
2855     ab1e
2856     No match
2857    
2858     /"([^\\"]+|\\.)*"/
2859     the \"quick\" brown fox
2860     0: "quick"
2861     1: quick
2862     \"the \\\"quick\\\" brown fox\"
2863     0: "the \"quick\" brown fox"
2864     1: brown fox
2865    
2866     /.*?/g+
2867     abc
2868     0:
2869     0+ abc
2870     0: a
2871     0+ bc
2872     0:
2873     0+ bc
2874     0: b
2875     0+ c
2876     0:
2877     0+ c
2878     0: c
2879     0+
2880     0:
2881     0+
2882    
2883     /\b/g+
2884     abc
2885     0:
2886     0+ abc
2887     0:
2888     0+
2889    
2890     /\b/+g
2891     abc
2892     0:
2893     0+ abc
2894     0:
2895     0+
2896    
2897     //g
2898     abc
2899     0:
2900     0:
2901     0:
2902     0:
2903    
2904 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
2905     <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>
2906     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>
2907     1: BGCOLOR='#DBE9E9'
2908     2: align=left valign=top
2909     3: 43.
2910     4: <a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)
2911     5:
2912     6:
2913     7: <unset>
2914     8: align=left valign=top
2915     9: Lega lstaff.com
2916     10: align=left valign=top
2917     11: CA - Statewide
2918 nigel 41
2919 nigel 49 /a[^a]b/
2920     acb
2921     0: acb
2922     a\nb
2923     0: a\x0ab
2924    
2925     /a.b/
2926     acb
2927     0: acb
2928     *** Failers
2929     No match
2930     a\nb
2931     No match
2932    
2933     /a[^a]b/s
2934     acb
2935     0: acb
2936     a\nb
2937     0: a\x0ab
2938    
2939     /a.b/s
2940     acb
2941     0: acb
2942     a\nb
2943     0: a\x0ab
2944    
2945 nigel 53 /^(b+?|a){1,2}?c/
2946     bac
2947     0: bac
2948     1: a
2949     bbac
2950     0: bbac
2951     1: a
2952     bbbac
2953     0: bbbac
2954     1: a
2955     bbbbac
2956     0: bbbbac
2957     1: a
2958     bbbbbac
2959     0: bbbbbac
2960     1: a
2961    
2962     /^(b+|a){1,2}?c/
2963     bac
2964     0: bac
2965     1: a
2966     bbac
2967     0: bbac
2968     1: a
2969     bbbac
2970     0: bbbac
2971     1: a
2972     bbbbac
2973     0: bbbbac
2974     1: a
2975     bbbbbac
2976     0: bbbbbac
2977     1: a
2978    
2979     /(?!\A)x/m
2980     x\nb\n
2981     No match
2982     a\bx\n
2983     0: x
2984    
2985     /\x0{ab}/
2986     \0{ab}
2987     0: \x00{ab}
2988    
2989 nigel 55 /(A|B)*?CD/
2990     CD
2991     0: CD
2992    
2993     /(A|B)*CD/
2994     CD
2995     0: CD
2996    
2997     /(AB)*?\1/
2998     ABABAB
2999     0: ABAB
3000     1: AB
3001    
3002     /(AB)*\1/
3003     ABABAB
3004     0: ABABAB
3005     1: AB
3006    
3007 nigel 63 /(?<!bar)foo/
3008     foo
3009     0: foo
3010     catfood
3011     0: foo
3012     arfootle
3013     0: foo
3014     rfoosh
3015     0: foo
3016     *** Failers
3017     No match
3018     barfoo
3019     No match
3020     towbarfoo
3021     No match
3022    
3023     /\w{3}(?<!bar)foo/
3024     catfood
3025     0: catfoo
3026     *** Failers
3027     No match
3028     foo
3029     No match
3030     barfoo
3031     No match
3032     towbarfoo
3033     No match
3034    
3035     /(?<=(foo)a)bar/
3036     fooabar
3037     0: bar
3038     1: foo
3039     *** Failers
3040     No match
3041     bar
3042     No match
3043     foobbar
3044     No match
3045    
3046     /\Aabc\z/m
3047     abc
3048     0: abc
3049     *** Failers
3050     No match
3051     abc\n
3052     No match
3053     qqq\nabc
3054     No match
3055     abc\nzzz
3056     No match
3057     qqq\nabc\nzzz
3058     No match
3059    
3060     "(?>.*/)foo"
3061     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
3062     No match
3063    
3064     "(?>.*/)foo"
3065     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
3066     0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
3067    
3068     /(?>(\.\d\d[1-9]?))\d+/
3069     1.230003938
3070     0: .230003938
3071     1: .23
3072     1.875000282
3073     0: .875000282
3074     1: .875
3075     *** Failers
3076     No match
3077     1.235
3078     No match
3079    
3080     /^((?>\w+)|(?>\s+))*$/
3081     now is the time for all good men to come to the aid of the party
3082     0: now is the time for all good men to come to the aid of the party
3083     1: party
3084     *** Failers
3085     No match
3086     this is not a line with only words and spaces!
3087     No match
3088    
3089     /(\d+)(\w)/
3090     12345a
3091     0: 12345a
3092     1: 12345
3093     2: a
3094     12345+
3095     0: 12345
3096     1: 1234
3097     2: 5
3098    
3099     /((?>\d+))(\w)/
3100     12345a
3101     0: 12345a
3102     1: 12345
3103     2: a
3104     *** Failers
3105     No match
3106     12345+
3107     No match
3108    
3109     /(?>a+)b/
3110     aaab
3111     0: aaab
3112    
3113     /((?>a+)b)/
3114     aaab
3115     0: aaab
3116     1: aaab
3117    
3118     /(?>(a+))b/
3119     aaab
3120     0: aaab
3121     1: aaa
3122    
3123     /(?>b)+/
3124     aaabbbccc
3125     0: bbb
3126    
3127     /(?>a+|b+|c+)*c/
3128     aaabbbbccccd
3129     0: aaabbbbc
3130    
3131     /((?>[^()]+)|\([^()]*\))+/
3132     ((abc(ade)ufh()()x
3133     0: abc(ade)ufh()()x
3134     1: x
3135    
3136     /\(((?>[^()]+)|\([^()]+\))+\)/
3137     (abc)
3138     0: (abc)
3139     1: abc
3140     (abc(def)xyz)
3141     0: (abc(def)xyz)
3142     1: xyz
3143     *** Failers
3144     No match
3145     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3146     No match
3147    
3148     /a(?-i)b/i
3149     ab
3150     0: ab
3151     Ab
3152     0: Ab
3153     *** Failers
3154     No match
3155     aB
3156     No match
3157     AB
3158     No match
3159    
3160     /(a (?x)b c)d e/
3161     a bcd e
3162     0: a bcd e
3163     1: a bc
3164     *** Failers
3165     No match
3166     a b cd e
3167     No match
3168     abcd e
3169     No match
3170     a bcde
3171     No match
3172    
3173     /(a b(?x)c d (?-x)e f)/
3174     a bcde f
3175     0: a bcde f
3176     1: a bcde f
3177     *** Failers
3178     No match
3179     abcdef
3180     No match
3181    
3182     /(a(?i)b)c/
3183     abc
3184     0: abc
3185     1: ab
3186     aBc
3187     0: aBc
3188     1: aB
3189     *** Failers
3190     No match
3191     abC
3192     No match
3193     aBC
3194     No match
3195     Abc
3196     No match
3197     ABc
3198     No match
3199     ABC
3200     No match
3201     AbC
3202     No match
3203    
3204     /a(?i:b)c/
3205     abc
3206     0: abc
3207     aBc
3208     0: aBc
3209     *** Failers
3210     No match
3211     ABC
3212     No match
3213     abC
3214     No match
3215     aBC
3216     No match
3217    
3218     /a(?i:b)*c/
3219     aBc
3220     0: aBc
3221     aBBc
3222     0: aBBc
3223     *** Failers
3224     No match
3225     aBC
3226     No match
3227     aBBC
3228     No match
3229    
3230     /a(?=b(?i)c)\w\wd/
3231     abcd
3232     0: abcd
3233     abCd
3234     0: abCd
3235     *** Failers
3236     No match
3237     aBCd
3238     No match
3239     abcD
3240     No match
3241    
3242     /(?s-i:more.*than).*million/i
3243     more than million
3244     0: more than million
3245     more than MILLION
3246     0: more than MILLION
3247     more \n than Million
3248     0: more \x0a than Million
3249     *** Failers
3250     No match
3251     MORE THAN MILLION
3252     No match
3253     more \n than \n million
3254     No match
3255    
3256     /(?:(?s-i)more.*than).*million/i
3257     more than million
3258     0: more than million
3259     more than MILLION
3260     0: more than MILLION
3261     more \n than Million
3262     0: more \x0a than Million
3263     *** Failers
3264     No match
3265     MORE THAN MILLION
3266     No match
3267     more \n than \n million
3268     No match
3269    
3270     /(?>a(?i)b+)+c/
3271     abc
3272     0: abc
3273     aBbc
3274     0: aBbc
3275     aBBc
3276     0: aBBc
3277     *** Failers
3278     No match
3279     Abc
3280     No match
3281     abAb
3282     No match
3283     abbC
3284     No match
3285    
3286     /(?=a(?i)b)\w\wc/
3287     abc
3288     0: abc
3289     aBc
3290     0: aBc
3291     *** Failers
3292     No match
3293     Ab
3294     No match
3295     abC
3296     No match
3297     aBC
3298     No match
3299    
3300     /(?<=a(?i)b)(\w\w)c/
3301     abxxc
3302     0: xxc
3303     1: xx
3304     aBxxc
3305     0: xxc
3306     1: xx
3307     *** Failers
3308     No match
3309     Abxxc
3310     No match
3311     ABxxc
3312     No match
3313     abxxC
3314     No match
3315    
3316     /(?:(a)|b)(?(1)A|B)/
3317     aA
3318     0: aA
3319     1: a
3320     bB
3321     0: bB
3322     *** Failers
3323     No match
3324     aB
3325     No match
3326     bA
3327     No match
3328    
3329     /^(a)?(?(1)a|b)+$/
3330     aa
3331     0: aa
3332     1: a
3333     b
3334     0: b
3335     bb
3336     0: bb
3337     *** Failers
3338     No match
3339     ab
3340     No match
3341    
3342     /^(?(?=abc)\w{3}:|\d\d)$/
3343     abc:
3344     0: abc:
3345     12
3346     0: 12
3347     *** Failers
3348     No match
3349     123
3350     No match
3351     xyz
3352     No match
3353    
3354     /^(?(?!abc)\d\d|\w{3}:)$/
3355     abc:
3356     0: abc:
3357     12
3358     0: 12
3359     *** Failers
3360     No match
3361     123
3362     No match
3363     xyz
3364     No match
3365    
3366     /(?(?<=foo)bar|cat)/
3367     foobar
3368     0: bar
3369     cat
3370     0: cat
3371     fcat
3372     0: cat
3373     focat
3374     0: cat
3375     *** Failers
3376     No match
3377     foocat
3378     No match
3379    
3380     /(?(?<!foo)cat|bar)/
3381     foobar
3382     0: bar
3383     cat
3384     0: cat
3385     fcat
3386     0: cat
3387     focat
3388     0: cat
3389     *** Failers
3390     No match
3391     foocat
3392     No match
3393    
3394     /( \( )? [^()]+ (?(1) \) |) /x
3395     abcd
3396     0: abcd
3397     (abcd)
3398     0: (abcd)
3399     1: (
3400     the quick (abcd) fox
3401     0: the quick
3402     (abcd
3403     0: abcd
3404    
3405     /( \( )? [^()]+ (?(1) \) ) /x
3406     abcd
3407     0: abcd
3408     (abcd)
3409     0: (abcd)
3410     1: (
3411     the quick (abcd) fox
3412     0: the quick
3413     (abcd
3414     0: abcd
3415    
3416     /^(?(2)a|(1)(2))+$/
3417     12
3418     0: 12
3419     1: 1
3420     2: 2
3421     12a
3422     0: 12a
3423     1: 1
3424     2: 2
3425     12aa
3426     0: 12aa
3427     1: 1
3428     2: 2
3429     *** Failers
3430     No match
3431     1234
3432     No match
3433    
3434     /((?i)blah)\s+\1/
3435     blah blah
3436     0: blah blah
3437     1: blah
3438     BLAH BLAH
3439     0: BLAH BLAH
3440     1: BLAH
3441     Blah Blah
3442     0: Blah Blah
3443     1: Blah
3444     blaH blaH
3445     0: blaH blaH
3446     1: blaH
3447     *** Failers
3448     No match
3449     blah BLAH
3450     No match
3451     Blah blah
3452     No match
3453     blaH blah
3454     No match
3455    
3456     /((?i)blah)\s+(?i:\1)/
3457     blah blah
3458     0: blah blah
3459     1: blah
3460     BLAH BLAH
3461     0: BLAH BLAH
3462     1: BLAH
3463     Blah Blah
3464     0: Blah Blah
3465     1: Blah
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    
3479     /(?>a*)*/
3480     a
3481     0: a
3482     aa
3483     0: aa
3484     aaaa
3485     0: aaaa
3486    
3487     /(abc|)+/
3488     abc
3489     0: abc
3490     1:
3491     abcabc
3492     0: abcabc
3493     1:
3494     abcabcabc
3495     0: abcabcabc
3496     1:
3497     xyz
3498     0:
3499     1:
3500    
3501     /([a]*)*/
3502     a
3503     0: a
3504     1:
3505     aaaaa
3506     0: aaaaa
3507     1:
3508    
3509     /([ab]*)*/
3510     a
3511     0: a
3512     1:
3513     b
3514     0: b
3515     1:
3516     ababab
3517     0: ababab
3518     1:
3519     aaaabcde
3520     0: aaaab
3521     1:
3522     bbbb
3523     0: bbbb
3524     1:
3525    
3526     /([^a]*)*/
3527     b
3528     0: b
3529     1:
3530     bbbb
3531     0: bbbb
3532     1:
3533     aaa
3534     0:
3535     1:
3536    
3537     /([^ab]*)*/
3538     cccc
3539     0: cccc
3540     1:
3541     abab
3542     0:
3543     1:
3544    
3545     /([a]*?)*/
3546     a
3547     0:
3548     1:
3549     aaaa
3550     0:
3551     1:
3552    
3553     /([ab]*?)*/
3554     a
3555     0:
3556     1:
3557     b
3558     0:
3559     1:
3560     abab
3561     0:
3562     1:
3563     baba
3564     0:
3565     1:
3566    
3567     /([^a]*?)*/
3568     b
3569     0:
3570     1:
3571     bbbb
3572     0:
3573     1:
3574     aaa
3575     0:
3576     1:
3577    
3578     /([^ab]*?)*/
3579     c
3580     0:
3581     1:
3582     cccc
3583     0:
3584     1:
3585     baba
3586     0:
3587     1:
3588    
3589     /(?>a*)*/
3590     a
3591     0: a
3592     aaabcde
3593     0: aaa
3594    
3595     /((?>a*))*/
3596     aaaaa
3597     0: aaaaa
3598     1:
3599     aabbaa
3600     0: aa
3601     1:
3602    
3603     /((?>a*?))*/
3604     aaaaa
3605     0:
3606     1:
3607     aabbaa
3608     0:
3609     1:
3610    
3611     /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
3612     12-sep-98
3613     0: 12-sep-98
3614     12-09-98
3615     0: 12-09-98
3616     *** Failers
3617     No match
3618     sep-12-98
3619     No match
3620    
3621     /(?<=(foo))bar\1/
3622     foobarfoo
3623     0: barfoo
3624     1: foo
3625     foobarfootling
3626     0: barfoo
3627     1: foo
3628     *** Failers
3629     No match
3630     foobar
3631     No match
3632     barfoo
3633     No match
3634    
3635     /(?i:saturday|sunday)/
3636     saturday
3637     0: saturday
3638     sunday
3639     0: sunday
3640     Saturday
3641     0: Saturday
3642     Sunday
3643     0: Sunday
3644     SATURDAY
3645     0: SATURDAY
3646     SUNDAY
3647     0: SUNDAY
3648     SunDay
3649     0: SunDay
3650    
3651     /(a(?i)bc|BB)x/
3652     abcx
3653     0: abcx
3654     1: abc
3655     aBCx
3656     0: aBCx
3657     1: aBC
3658     bbx
3659     0: bbx
3660     1: bb
3661     BBx
3662     0: BBx
3663     1: BB
3664     *** Failers
3665     No match
3666     abcX
3667     No match
3668     aBCX
3669     No match
3670     bbX
3671     No match
3672     BBX
3673     No match
3674    
3675     /^([ab](?i)[cd]|[ef])/
3676     ac
3677     0: ac
3678     1: ac
3679     aC
3680     0: aC
3681     1: aC
3682     bD
3683     0: bD
3684     1: bD
3685     elephant
3686     0: e
3687     1: e
3688     Europe
3689     0: E
3690     1: E
3691     frog
3692     0: f
3693     1: f
3694     France
3695     0: F
3696     1: F
3697     *** Failers
3698     No match
3699     Africa
3700     No match
3701    
3702     /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
3703     ab
3704     0: ab
3705     1: ab
3706     aBd
3707     0: aBd
3708     1: aBd
3709     xy
3710     0: xy
3711     1: xy
3712     xY
3713     0: xY
3714     1: xY
3715     zebra
3716     0: z
3717     1: z
3718     Zambesi
3719     0: Z
3720     1: Z
3721     *** Failers
3722     No match
3723     aCD
3724     No match
3725     XY
3726     No match
3727    
3728     /(?<=foo\n)^bar/m
3729     foo\nbar
3730     0: bar
3731     *** Failers
3732     No match
3733     bar
3734     No match
3735     baz\nbar
3736     No match
3737    
3738     /(?<=(?<!foo)bar)baz/
3739     barbaz
3740     0: baz
3741     barbarbaz
3742     0: baz
3743     koobarbaz
3744     0: baz
3745     *** Failers
3746     No match
3747     baz
3748     No match
3749     foobarbaz
3750     No match
3751    
3752     /The case of aaaaaa is missed out below because I think Perl 5.005_02 gets/
3753     /it wrong; it sets $1 to aaa rather than aa. Compare the following test,/
3754     No match
3755     /where it does set $1 to aa when matching aaaaaa./
3756     No match
3757    
3758     /^(a\1?){4}$/
3759     a
3760     No match
3761     aa
3762     No match
3763     aaa
3764     No match
3765     aaaa
3766     0: aaaa
3767     1: a
3768     aaaaa
3769     0: aaaaa
3770     1: a
3771     aaaaaaa
3772     0: aaaaaaa
3773     1: a
3774     aaaaaaaa
3775     No match
3776     aaaaaaaaa
3777     No match
3778     aaaaaaaaaa
3779     0: aaaaaaaaaa
3780     1: aaaa
3781     aaaaaaaaaaa
3782     No match
3783     aaaaaaaaaaaa
3784     No match
3785     aaaaaaaaaaaaa
3786     No match
3787     aaaaaaaaaaaaaa
3788     No match
3789     aaaaaaaaaaaaaaa
3790     No match
3791     aaaaaaaaaaaaaaaa
3792     No match
3793    
3794     /^(a\1?)(a\1?)(a\2?)(a\3?)$/
3795     a
3796     No match
3797     aa
3798     No match
3799     aaa
3800     No match
3801     aaaa
3802     0: aaaa
3803     1: a
3804     2: a
3805     3: a
3806     4: a
3807     aaaaa
3808     0: aaaaa
3809     1: a
3810     2: aa
3811     3: a
3812     4: a
3813     aaaaaa
3814     0: aaaaaa
3815     1: a
3816     2: aa
3817     3: a
3818     4: aa
3819     aaaaaaa
3820     0: aaaaaaa
3821     1: a
3822     2: aa
3823     3: aaa
3824     4: a
3825     aaaaaaaa
3826     No match
3827     aaaaaaaaa
3828     No match
3829     aaaaaaaaaa
3830     0: aaaaaaaaaa
3831     1: a
3832     2: aa
3833     3: aaa
3834     4: aaaa
3835     aaaaaaaaaaa
3836     No match
3837     aaaaaaaaaaaa
3838     No match
3839     aaaaaaaaaaaaa
3840     No match
3841     aaaaaaaaaaaaaa
3842     No match
3843     aaaaaaaaaaaaaaa
3844     No match
3845     aaaaaaaaaaaaaaaa
3846     No match
3847    
3848     /The following tests are taken from the Perl 5.005 test suite; some of them/
3849     /are compatible with 5.004, but I'd rather not have to sort them out./
3850     No match
3851    
3852     /abc/
3853     abc
3854     0: abc
3855     xabcy
3856     0: abc
3857     ababc
3858     0: abc
3859     *** Failers
3860     No match
3861     xbc
3862     No match
3863     axc
3864     No match
3865     abx
3866     No match
3867    
3868     /ab*c/
3869     abc
3870     0: abc
3871    
3872     /ab*bc/
3873     abc
3874     0: abc
3875     abbc
3876     0: abbc
3877     abbbbc
3878     0: abbbbc
3879    
3880     /.{1}/
3881     abbbbc
3882     0: a
3883    
3884     /.{3,4}/
3885     abbbbc
3886     0: abbb
3887    
3888     /ab{0,}bc/
3889     abbbbc
3890     0: abbbbc
3891    
3892     /ab+bc/
3893     abbc
3894     0: abbc
3895     *** Failers
3896     No match
3897     abc
3898     No match
3899     abq
3900     No match
3901    
3902     /ab{1,}bc/
3903    
3904     /ab+bc/
3905     abbbbc
3906     0: abbbbc
3907    
3908     /ab{1,}bc/
3909     abbbbc
3910     0: abbbbc
3911    
3912     /ab{1,3}bc/
3913     abbbbc
3914     0: abbbbc
3915    
3916     /ab{3,4}bc/
3917     abbbbc
3918     0: abbbbc
3919    
3920     /ab{4,5}bc/
3921     *** Failers
3922     No match
3923     abq
3924     No match
3925     abbbbc
3926     No match
3927    
3928     /ab?bc/
3929     abbc
3930     0: abbc
3931     abc
3932     0: abc
3933    
3934     /ab{0,1}bc/
3935     abc
3936     0: abc
3937    
3938     /ab?bc/
3939    
3940     /ab?c/
3941     abc
3942     0: abc
3943    
3944     /ab{0,1}c/
3945     abc
3946     0: abc
3947    
3948     /^abc$/
3949     abc
3950     0: abc
3951     *** Failers
3952     No match
3953     abbbbc
3954     No match
3955     abcc
3956     No match
3957    
3958     /^abc/
3959     abcc
3960     0: abc
3961    
3962     /^abc$/
3963    
3964     /abc$/
3965     aabc
3966     0: abc
3967     *** Failers
3968     No match
3969     aabc
3970     0: abc
3971     aabcd
3972     No match
3973    
3974     /^/
3975     abc
3976     0:
3977    
3978     /$/
3979     abc
3980     0:
3981    
3982     /a.c/
3983     abc
3984     0: abc
3985     axc
3986     0: axc
3987    
3988     /a.*c/
3989     axyzc
3990     0: axyzc
3991    
3992     /a[bc]d/
3993     abd
3994     0: abd
3995     *** Failers
3996     No match
3997     axyzd
3998     No match
3999     abc
4000     No match
4001    
4002     /a[b-d]e/
4003     ace
4004     0: ace
4005    
4006     /a[b-d]/
4007     aac
4008     0: ac
4009    
4010     /a[-b]/
4011     a-
4012     0: a-
4013    
4014     /a[b-]/
4015     a-
4016     0: a-
4017    
4018     /a]/
4019     a]
4020     0: a]
4021    
4022     /a[]]b/
4023     a]b
4024     0: a]b
4025    
4026     /a[^bc]d/
4027     aed
4028     0: aed
4029     *** Failers
4030     No match
4031     abd
4032     No match
4033     abd
4034     No match
4035    
4036     /a[^-b]c/
4037     adc
4038     0: adc
4039    
4040     /a[^]b]c/
4041     adc
4042     0: adc
4043     *** Failers
4044     No match
4045     a-c
4046     0: a-c
4047     a]c
4048     No match
4049    
4050     /\ba\b/
4051     a-
4052     0: a
4053     -a
4054     0: a
4055     -a-
4056     0: a
4057    
4058     /\by\b/
4059     *** Failers
4060     No match
4061     xy
4062     No match
4063     yz
4064     No match
4065     xyz
4066     No match
4067    
4068     /\Ba\B/
4069     *** Failers
4070     0: a
4071     a-
4072     No match
4073     -a
4074     No match
4075     -a-
4076     No match
4077    
4078     /\By\b/
4079     xy
4080     0: y
4081    
4082     /\by\B/
4083     yz
4084     0: y
4085    
4086     /\By\B/
4087     xyz
4088     0: y
4089    
4090     /\w/
4091     a
4092     0: a
4093    
4094     /\W/
4095     -
4096     0: -
4097     *** Failers
4098     0: *
4099     -
4100     0: -
4101     a
4102     No match
4103    
4104     /a\sb/
4105     a b
4106     0: a b
4107    
4108     /a\Sb/
4109     a-b
4110     0: a-b
4111     *** Failers
4112     No match
4113     a-b
4114     0: a-b
4115     a b
4116     No match
4117    
4118     /\d/
4119     1
4120     0: 1
4121    
4122     /\D/
4123     -
4124     0: -
4125     *** Failers
4126     0: *
4127     -
4128     0: -
4129     1
4130     No match
4131    
4132     /[\w]/
4133     a
4134     0: a
4135    
4136     /[\W]/
4137     -
4138     0: -
4139     *** Failers
4140     0: *
4141     -
4142     0: -
4143     a
4144     No match
4145    
4146     /a[\s]b/
4147     a b
4148     0: a b
4149    
4150     /a[\S]b/
4151     a-b
4152     0: a-b
4153     *** Failers
4154     No match
4155     a-b
4156     0: a-b
4157     a b
4158     No match
4159    
4160     /[\d]/
4161     1
4162     0: 1
4163    
4164     /[\D]/
4165     -
4166     0: -
4167     *** Failers
4168     0: *
4169     -
4170     0: -
4171     1
4172     No match
4173    
4174     /ab|cd/
4175     abc
4176     0: ab
4177     abcd
4178     0: ab
4179    
4180     /()ef/
4181     def
4182     0: ef
4183     1:
4184    
4185     /$b/
4186    
4187     /a\(b/
4188     a(b
4189     0: a(b
4190    
4191     /a\(*b/
4192     ab
4193     0: ab
4194     a((b
4195     0: a((b
4196    
4197     /a\\b/
4198     a\b
4199     No match
4200    
4201     /((a))/
4202     abc
4203     0: a
4204     1: a
4205     2: a
4206    
4207     /(a)b(c)/
4208     abc
4209     0: abc
4210     1: a
4211     2: c
4212    
4213     /a+b+c/
4214     aabbabc
4215     0: abc
4216    
4217     /a{1,}b{1,}c/
4218     aabbabc
4219     0: abc
4220    
4221     /a.+?c/
4222     abcabc
4223     0: abc
4224    
4225     /(a+|b)*/
4226     ab
4227     0: ab
4228     1: b
4229    
4230     /(a+|b){0,}/
4231     ab
4232     0: ab
4233     1: b
4234    
4235     /(a+|b)+/
4236     ab
4237     0: ab
4238     1: b
4239    
4240     /(a+|b){1,}/
4241     ab
4242     0: ab
4243     1: b
4244    
4245     /(a+|b)?/
4246     ab
4247     0: a
4248     1: a
4249    
4250     /(a+|b){0,1}/
4251     ab
4252     0: a
4253     1: a
4254    
4255     /[^ab]*/
4256     cde
4257     0: cde
4258    
4259     /abc/
4260     *** Failers
4261     No match
4262     b
4263     No match
4264    
4265    
4266     /a*/
4267    
4268    
4269     /([abc])*d/
4270     abbbcd
4271     0: abbbcd
4272     1: c
4273    
4274     /([abc])*bcd/
4275     abcd
4276     0: abcd
4277     1: a
4278    
4279     /a|b|c|d|e/
4280     e
4281     0: e
4282    
4283     /(a|b|c|d|e)f/
4284     ef
4285     0: ef
4286     1: e
4287    
4288     /abcd*efg/
4289     abcdefg
4290     0: abcdefg
4291    
4292     /ab*/
4293     xabyabbbz
4294     0: ab
4295     xayabbbz
4296     0: a
4297    
4298     /(ab|cd)e/
4299     abcde
4300     0: cde
4301     1: cd
4302    
4303     /[abhgefdc]ij/
4304     hij
4305     0: hij
4306    
4307     /^(ab|cd)e/
4308    
4309     /(abc|)ef/
4310     abcdef
4311     0: ef
4312     1:
4313    
4314     /(a|b)c*d/
4315     abcd
4316     0: bcd
4317     1: b
4318    
4319     /(ab|ab*)bc/
4320     abc
4321     0: abc
4322     1: a
4323    
4324     /a([bc]*)c*/
4325     abc
4326     0: abc
4327     1: bc
4328    
4329     /a([bc]*)(c*d)/
4330     abcd
4331     0: abcd
4332     1: bc
4333     2: d
4334    
4335     /a([bc]+)(c*d)/
4336     abcd
4337     0: abcd
4338     1: bc
4339     2: d
4340    
4341     /a([bc]*)(c+d)/
4342     abcd
4343     0: abcd
4344     1: b
4345     2: cd
4346    
4347     /a[bcd]*dcdcde/
4348     adcdcde
4349     0: adcdcde
4350    
4351     /a[bcd]+dcdcde/
4352     *** Failers
4353     No match
4354     abcde
4355     No match
4356     adcdcde
4357     No match
4358    
4359     /(ab|a)b*c/
4360     abc
4361     0: abc
4362     1: ab
4363    
4364     /((a)(b)c)(d)/
4365     abcd
4366     0: abcd
4367     1: abc
4368     2: a
4369     3: b
4370     4: d
4371    
4372     /[a-zA-Z_][a-zA-Z0-9_]*/
4373     alpha
4374     0: alpha
4375    
4376     /^a(bc+|b[eh])g|.h$/
4377     abh
4378     0: bh
4379    
4380     /(bc+d$|ef*g.|h?i(j|k))/
4381     effgz
4382     0: effgz
4383     1: effgz
4384     ij
4385     0: ij
4386     1: ij
4387     2: j
4388     reffgz
4389     0: effgz
4390     1: effgz
4391     *** Failers
4392     No match
4393     effg
4394     No match
4395     bcdd
4396     No match
4397    
4398     /((((((((((a))))))))))/
4399     a
4400     0: a
4401     1: a
4402     2: a
4403     3: a
4404     4: a
4405     5: a
4406     6: a
4407     7: a
4408     8: a
4409     9: a
4410     10: a
4411    
4412     /((((((((((a))))))))))\10/
4413     aa
4414     0: aa
4415     1: a
4416     2: a
4417     3: a
4418     4: a
4419     5: a
4420     6: a
4421     7: a
4422     8: a
4423     9: a
4424     10: a
4425    
4426     /(((((((((a)))))))))/
4427     a
4428     0: a
4429     1: a
4430     2: a
4431     3: a
4432     4: a
4433     5: a
4434     6: a
4435     7: a
4436     8: a
4437     9: a
4438    
4439     /multiple words of text/
4440     *** Failers
4441     No match
4442     aa
4443     No match
4444     uh-uh
4445     No match
4446    
4447     /multiple words/
4448     multiple words, yeah
4449     0: multiple words
4450    
4451     /(.*)c(.*)/
4452     abcde
4453     0: abcde
4454     1: ab
4455     2: de
4456    
4457     /\((.*), (.*)\)/
4458     (a, b)
4459     0: (a, b)
4460     1: a
4461     2: b
4462    
4463     /[k]/
4464    
4465     /abcd/
4466     abcd
4467     0: abcd
4468    
4469     /a(bc)d/
4470     abcd
4471     0: abcd
4472     1: bc
4473    
4474     /a[-]?c/
4475     ac
4476     0: ac
4477    
4478     /(abc)\1/
4479     abcabc
4480     0: abcabc
4481     1: abc
4482    
4483     /([a-c]*)\1/
4484     abcabc
4485     0: abcabc
4486     1: abc
4487    
4488     /(a)|\1/
4489     a
4490     0: a
4491     1: a
4492     *** Failers
4493     0: a
4494     1: a
4495     ab
4496     0: a
4497     1: a
4498     x
4499     No match
4500    
4501     /(([a-c])b*?\2)*/
4502     ababbbcbc
4503     0: ababb
4504     1: bb
4505     2: b
4506    
4507     /(([a-c])b*?\2){3}/
4508     ababbbcbc
4509     0: ababbbcbc
4510     1: cbc
4511     2: c
4512    
4513     /((\3|b)\2(a)x)+/
4514     aaaxabaxbaaxbbax
4515     0: bbax
4516     1: bbax
4517     2: b
4518     3: a
4519    
4520     /((\3|b)\2(a)){2,}/
4521     bbaababbabaaaaabbaaaabba
4522     0: bbaaaabba
4523     1: bba
4524     2: b
4525     3: a
4526    
4527     /abc/i
4528     ABC
4529     0: ABC
4530     XABCY
4531     0: ABC
4532     ABABC
4533     0: ABC
4534     *** Failers
4535     No match
4536     aaxabxbaxbbx
4537     No match
4538     XBC
4539     No match
4540     AXC
4541     No match
4542     ABX
4543     No match
4544    
4545     /ab*c/i
4546     ABC
4547     0: ABC
4548    
4549     /ab*bc/i
4550     ABC
4551     0: ABC
4552     ABBC
4553     0: ABBC
4554    
4555     /ab*?bc/i
4556     ABBBBC
4557     0: ABBBBC
4558    
4559     /ab{0,}?bc/i
4560     ABBBBC
4561     0: ABBBBC
4562    
4563     /ab+?bc/i
4564     ABBC
4565     0: ABBC
4566    
4567     /ab+bc/i
4568     *** Failers
4569     No match
4570     ABC
4571     No match
4572     ABQ
4573     No match
4574    
4575     /ab{1,}bc/i
4576    
4577     /ab+bc/i
4578     ABBBBC
4579     0: ABBBBC
4580    
4581     /ab{1,}?bc/i
4582     ABBBBC
4583     0: ABBBBC
4584    
4585     /ab{1,3}?bc/i
4586     ABBBBC
4587     0: ABBBBC
4588    
4589     /ab{3,4}?bc/i
4590     ABBBBC
4591     0: ABBBBC
4592    
4593     /ab{4,5}?bc/i
4594     *** Failers
4595     No match
4596     ABQ
4597     No match
4598     ABBBBC
4599     No match
4600