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

Contents of /code/trunk/testdata/testoutput1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 472 - (hide annotations) (download)
Fri Dec 11 16:42:50 2009 UTC (3 years, 5 months ago) by ph10
File size: 102224 byte(s)
Fix options set and reset at top level bug.

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