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

Contents of /code/trunk/testdata/testinput1

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords "Author Date Id Revision Url"

  ViewVC Help
Powered by ViewVC 1.1.5