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

Contents of /code/trunk/testdata/testoutput1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1315 - (hide annotations) (download)
Fri Apr 26 11:16:43 2013 UTC (3 weeks, 4 days ago) by ph10
File size: 132641 byte(s)
Tidy up comment in test input.

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