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

Contents of /code/trunk/testdata/testinput1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93 - (hide annotations) (download)
Sat Feb 24 21:41:42 2007 UTC (7 years, 1 month ago) by nigel
File size: 75951 byte(s)
Load pcre-7.0 into code/trunk.

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12