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

Contents of /code/trunk/testdata/testoutput1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1487 - (hide annotations) (download)
Wed Jun 18 17:17:03 2014 UTC (5 weeks ago) by ph10
File size: 135195 byte(s)
Fix bad compile of [\Qx]...  where x is any character.

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