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

Contents of /code/trunk/testdata/testinput1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1370 - (show annotations)
Wed Oct 9 10:18:26 2013 UTC (6 years, 4 months ago) by ph10
File size: 98098 byte(s)
Error occurred while calculating annotation data.
Add \o{} and tidy up \x{} handling. Minor update to RunTest.
1 /-- This set of tests is for features that are compatible with all versions of
2 Perl >= 5.10, in non-UTF-8 mode. It should run clean for the 8-bit, 16-bit,
3 and 32-bit PCRE libraries. --/
4
5 /the quick brown fox/
6 the quick brown fox
7 The quick brown FOX
8 What do you know about the quick brown fox?
9 What do you know about THE QUICK BROWN FOX?
10
11 /The quick brown fox/i
12 the quick brown fox
13 The quick brown FOX
14 What do you know about the quick brown fox?
15 What do you know about THE QUICK BROWN FOX?
16
17 /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
18 abcd\t\n\r\f\a\e9;\$\\?caxyz
19
20 /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
21 abxyzpqrrrabbxyyyypqAzz
22 abxyzpqrrrabbxyyyypqAzz
23 aabxyzpqrrrabbxyyyypqAzz
24 aaabxyzpqrrrabbxyyyypqAzz
25 aaaabxyzpqrrrabbxyyyypqAzz
26 abcxyzpqrrrabbxyyyypqAzz
27 aabcxyzpqrrrabbxyyyypqAzz
28 aaabcxyzpqrrrabbxyyyypAzz
29 aaabcxyzpqrrrabbxyyyypqAzz
30 aaabcxyzpqrrrabbxyyyypqqAzz
31 aaabcxyzpqrrrabbxyyyypqqqAzz
32 aaabcxyzpqrrrabbxyyyypqqqqAzz
33 aaabcxyzpqrrrabbxyyyypqqqqqAzz
34 aaabcxyzpqrrrabbxyyyypqqqqqqAzz
35 aaaabcxyzpqrrrabbxyyyypqAzz
36 abxyzzpqrrrabbxyyyypqAzz
37 aabxyzzzpqrrrabbxyyyypqAzz
38 aaabxyzzzzpqrrrabbxyyyypqAzz
39 aaaabxyzzzzpqrrrabbxyyyypqAzz
40 abcxyzzpqrrrabbxyyyypqAzz
41 aabcxyzzzpqrrrabbxyyyypqAzz
42 aaabcxyzzzzpqrrrabbxyyyypqAzz
43 aaaabcxyzzzzpqrrrabbxyyyypqAzz
44 aaaabcxyzzzzpqrrrabbbxyyyypqAzz
45 aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
46 aaabcxyzpqrrrabbxyyyypABzz
47 aaabcxyzpqrrrabbxyyyypABBzz
48 >>>aaabxyzpqrrrabbxyyyypqAzz
49 >aaaabxyzpqrrrabbxyyyypqAzz
50 >>>>abcxyzpqrrrabbxyyyypqAzz
51 *** Failers
52 abxyzpqrrabbxyyyypqAzz
53 abxyzpqrrrrabbxyyyypqAzz
54 abxyzpqrrrabxyyyypqAzz
55 aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
56 aaaabcxyzzzzpqrrrabbbxyyypqAzz
57 aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
58
59 /^(abc){1,2}zz/
60 abczz
61 abcabczz
62 *** Failers
63 zz
64 abcabcabczz
65 >>abczz
66
67 /^(b+?|a){1,2}?c/
68 bc
69 bbc
70 bbbc
71 bac
72 bbac
73 aac
74 abbbbbbbbbbbc
75 bbbbbbbbbbbac
76 *** Failers
77 aaac
78 abbbbbbbbbbbac
79
80 /^(b+|a){1,2}c/
81 bc
82 bbc
83 bbbc
84 bac
85 bbac
86 aac
87 abbbbbbbbbbbc
88 bbbbbbbbbbbac
89 *** Failers
90 aaac
91 abbbbbbbbbbbac
92
93 /^(b+|a){1,2}?bc/
94 bbc
95
96 /^(b*|ba){1,2}?bc/
97 babc
98 bbabc
99 bababc
100 *** Failers
101 bababbc
102 babababc
103
104 /^(ba|b*){1,2}?bc/
105 babc
106 bbabc
107 bababc
108 *** Failers
109 bababbc
110 babababc
111
112 /^\ca\cA\c[\c{\c:/
113 \x01\x01\e;z
114
115 /^[ab\]cde]/
116 athing
117 bthing
118 ]thing
119 cthing
120 dthing
121 ething
122 *** Failers
123 fthing
124 [thing
125 \\thing
126
127 /^[]cde]/
128 ]thing
129 cthing
130 dthing
131 ething
132 *** Failers
133 athing
134 fthing
135
136 /^[^ab\]cde]/
137 fthing
138 [thing
139 \\thing
140 *** Failers
141 athing
142 bthing
143 ]thing
144 cthing
145 dthing
146 ething
147
148 /^[^]cde]/
149 athing
150 fthing
151 *** Failers
152 ]thing
153 cthing
154 dthing
155 ething
156
157 /^\/
158
159
160 /^/
161
162
163 /^[0-9]+$/
164 0
165 1
166 2
167 3
168 4
169 5
170 6
171 7
172 8
173 9
174 10
175 100
176 *** Failers
177 abc
178
179 /^.*nter/
180 enter
181 inter
182 uponter
183
184 /^xxx[0-9]+$/
185 xxx0
186 xxx1234
187 *** Failers
188 xxx
189
190 /^.+[0-9][0-9][0-9]$/
191 x123
192 xx123
193 123456
194 *** Failers
195 123
196 x1234
197
198 /^.+?[0-9][0-9][0-9]$/
199 x123
200 xx123
201 123456
202 *** Failers
203 123
204 x1234
205
206 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
207 abc!pqr=apquxz.ixr.zzz.ac.uk
208 *** Failers
209 !pqr=apquxz.ixr.zzz.ac.uk
210 abc!=apquxz.ixr.zzz.ac.uk
211 abc!pqr=apquxz:ixr.zzz.ac.uk
212 abc!pqr=apquxz.ixr.zzz.ac.ukk
213
214 /:/
215 Well, we need a colon: somewhere
216 *** Fail if we don't
217
218 /([\da-f:]+)$/i
219 0abc
220 abc
221 fed
222 E
223 ::
224 5f03:12C0::932e
225 fed def
226 Any old stuff
227 *** Failers
228 0zzz
229 gzzz
230 fed\x20
231 Any old rubbish
232
233 /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
234 .1.2.3
235 A.12.123.0
236 *** Failers
237 .1.2.3333
238 1.2.3
239 1234.2.3
240
241 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
242 1 IN SOA non-sp1 non-sp2(
243 1 IN SOA non-sp1 non-sp2 (
244 *** Failers
245 1IN SOA non-sp1 non-sp2(
246
247 /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
248 a.
249 Z.
250 2.
251 ab-c.pq-r.
252 sxk.zzz.ac.uk.
253 x-.y-.
254 *** Failers
255 -abc.peq.
256
257 /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
258 *.a
259 *.b0-a
260 *.c3-b.c
261 *.c-a.b-c
262 *** Failers
263 *.0
264 *.a-
265 *.a-b.c-
266 *.c-a.0-c
267
268 /^(?=ab(de))(abd)(e)/
269 abde
270
271 /^(?!(ab)de|x)(abd)(f)/
272 abdf
273
274 /^(?=(ab(cd)))(ab)/
275 abcd
276
277 /^[\da-f](\.[\da-f])*$/i
278 a.b.c.d
279 A.B.C.D
280 a.b.c.1.2.3.C
281
282 /^\".*\"\s*(;.*)?$/
283 \"1234\"
284 \"abcd\" ;
285 \"\" ; rhubarb
286 *** Failers
287 \"1234\" : things
288
289 /^$/
290 \
291 *** Failers
292
293 / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
294 ab c
295 *** Failers
296 abc
297 ab cde
298
299 /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
300 ab c
301 *** Failers
302 abc
303 ab cde
304
305 /^ a\ b[c ]d $/x
306 a bcd
307 a b d
308 *** Failers
309 abcd
310 ab d
311
312 /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
313 abcdefhijklm
314
315 /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
316 abcdefhijklm
317
318 /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
319 a+ Z0+\x08\n\x1d\x12
320
321 /^[.^$|()*+?{,}]+/
322 .^\$(*+)|{?,?}
323
324 /^a*\w/
325 z
326 az
327 aaaz
328 a
329 aa
330 aaaa
331 a+
332 aa+
333
334 /^a*?\w/
335 z
336 az
337 aaaz
338 a
339 aa
340 aaaa
341 a+
342 aa+
343
344 /^a+\w/
345 az
346 aaaz
347 aa
348 aaaa
349 aa+
350
351 /^a+?\w/
352 az
353 aaaz
354 aa
355 aaaa
356 aa+
357
358 /^\d{8}\w{2,}/
359 1234567890
360 12345678ab
361 12345678__
362 *** Failers
363 1234567
364
365 /^[aeiou\d]{4,5}$/
366 uoie
367 1234
368 12345
369 aaaaa
370 *** Failers
371 123456
372
373 /^[aeiou\d]{4,5}?/
374 uoie
375 1234
376 12345
377 aaaaa
378 123456
379
380 /\A(abc|def)=(\1){2,3}\Z/
381 abc=abcabc
382 def=defdefdef
383 *** Failers
384 abc=defdef
385
386 /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/
387 abcdefghijkcda2
388 abcdefghijkkkkcda2
389
390 /(cat(a(ract|tonic)|erpillar)) \1()2(3)/
391 cataract cataract23
392 catatonic catatonic23
393 caterpillar caterpillar23
394
395
396 /^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]/
397 From abcd Mon Sep 01 12:33:02 1997
398
399 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
400 From abcd Mon Sep 01 12:33:02 1997
401 From abcd Mon Sep 1 12:33:02 1997
402 *** Failers
403 From abcd Sep 01 12:33:02 1997
404
405 /^12.34/s
406 12\n34
407 12\r34
408
409 /\w+(?=\t)/
410 the quick brown\t fox
411
412 /foo(?!bar)(.*)/
413 foobar is foolish see?
414
415 /(?:(?!foo)...|^.{0,2})bar(.*)/
416 foobar crowbar etc
417 barrel
418 2barrel
419 A barrel
420
421 /^(\D*)(?=\d)(?!123)/
422 abc456
423 *** Failers
424 abc123
425
426 /^1234(?# test newlines
427 inside)/
428 1234
429
430 /^1234 #comment in extended re
431 /x
432 1234
433
434 /#rhubarb
435 abcd/x
436 abcd
437
438 /^abcd#rhubarb/x
439 abcd
440
441 /^(a)\1{2,3}(.)/
442 aaab
443 aaaab
444 aaaaab
445 aaaaaab
446
447 /(?!^)abc/
448 the abc
449 *** Failers
450 abc
451
452 /(?=^)abc/
453 abc
454 *** Failers
455 the abc
456
457 /^[ab]{1,3}(ab*|b)/
458 aabbbbb
459
460 /^[ab]{1,3}?(ab*|b)/
461 aabbbbb
462
463 /^[ab]{1,3}?(ab*?|b)/
464 aabbbbb
465
466 /^[ab]{1,3}(ab*?|b)/
467 aabbbbb
468
469 / (?: [\040\t] | \(
470 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
471 \) )* # optional leading comment
472 (?: (?:
473 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
474 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
475 |
476 " (?: # opening quote...
477 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
478 | # or
479 \\ [^\x80-\xff] # Escaped something (something != CR)
480 )* " # closing quote
481 ) # initial word
482 (?: (?: [\040\t] | \(
483 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
484 \) )* \. (?: [\040\t] | \(
485 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
486 \) )* (?:
487 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
488 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
489 |
490 " (?: # opening quote...
491 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
492 | # or
493 \\ [^\x80-\xff] # Escaped something (something != CR)
494 )* " # closing quote
495 ) )* # further okay, if led by a period
496 (?: [\040\t] | \(
497 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
498 \) )* @ (?: [\040\t] | \(
499 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
500 \) )* (?:
501 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
502 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
503 | \[ # [
504 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
505 \] # ]
506 ) # initial subdomain
507 (?: #
508 (?: [\040\t] | \(
509 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
510 \) )* \. # if led by a period...
511 (?: [\040\t] | \(
512 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
513 \) )* (?:
514 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
515 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
516 | \[ # [
517 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
518 \] # ]
519 ) # ...further okay
520 )*
521 # address
522 | # or
523 (?:
524 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
525 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
526 |
527 " (?: # opening quote...
528 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
529 | # or
530 \\ [^\x80-\xff] # Escaped something (something != CR)
531 )* " # closing quote
532 ) # one word, optionally followed by....
533 (?:
534 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
535 \(
536 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
537 \) | # comments, or...
538
539 " (?: # opening quote...
540 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
541 | # or
542 \\ [^\x80-\xff] # Escaped something (something != CR)
543 )* " # closing quote
544 # quoted strings
545 )*
546 < (?: [\040\t] | \(
547 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
548 \) )* # leading <
549 (?: @ (?: [\040\t] | \(
550 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
551 \) )* (?:
552 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
553 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
554 | \[ # [
555 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
556 \] # ]
557 ) # initial subdomain
558 (?: #
559 (?: [\040\t] | \(
560 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
561 \) )* \. # if led by a period...
562 (?: [\040\t] | \(
563 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
564 \) )* (?:
565 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
566 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
567 | \[ # [
568 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
569 \] # ]
570 ) # ...further okay
571 )*
572
573 (?: (?: [\040\t] | \(
574 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
575 \) )* , (?: [\040\t] | \(
576 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
577 \) )* @ (?: [\040\t] | \(
578 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
579 \) )* (?:
580 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
581 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
582 | \[ # [
583 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
584 \] # ]
585 ) # initial subdomain
586 (?: #
587 (?: [\040\t] | \(
588 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
589 \) )* \. # if led by a period...
590 (?: [\040\t] | \(
591 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
592 \) )* (?:
593 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
594 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
595 | \[ # [
596 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
597 \] # ]
598 ) # ...further okay
599 )*
600 )* # further okay, if led by comma
601 : # closing colon
602 (?: [\040\t] | \(
603 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
604 \) )* )? # optional route
605 (?:
606 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
607 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
608 |
609 " (?: # opening quote...
610 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
611 | # or
612 \\ [^\x80-\xff] # Escaped something (something != CR)
613 )* " # closing quote
614 ) # initial word
615 (?: (?: [\040\t] | \(
616 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
617 \) )* \. (?: [\040\t] | \(
618 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
619 \) )* (?:
620 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
621 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
622 |
623 " (?: # opening quote...
624 [^\\\x80-\xff\n\015"] # Anything except backslash and quote
625 | # or
626 \\ [^\x80-\xff] # Escaped something (something != CR)
627 )* " # closing quote
628 ) )* # further okay, if led by a period
629 (?: [\040\t] | \(
630 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
631 \) )* @ (?: [\040\t] | \(
632 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
633 \) )* (?:
634 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
635 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
636 | \[ # [
637 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
638 \] # ]
639 ) # initial subdomain
640 (?: #
641 (?: [\040\t] | \(
642 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
643 \) )* \. # if led by a period...
644 (?: [\040\t] | \(
645 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
646 \) )* (?:
647 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
648 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
649 | \[ # [
650 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
651 \] # ]
652 ) # ...further okay
653 )*
654 # address spec
655 (?: [\040\t] | \(
656 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
657 \) )* > # trailing >
658 # name and address
659 ) (?: [\040\t] | \(
660 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
661 \) )* # optional trailing comment
662 /x
663 Alan Other <user\@dom.ain>
664 <user\@dom.ain>
665 user\@dom.ain
666 \"A. Other\" <user.1234\@dom.ain> (a comment)
667 A. Other <user.1234\@dom.ain> (a comment)
668 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
669 A missing angle <user\@some.where
670 *** Failers
671 The quick brown fox
672
673 /[\040\t]* # Nab whitespace.
674 (?:
675 \( # (
676 [^\\\x80-\xff\n\015()] * # normal*
677 (?: # (
678 (?: \\ [^\x80-\xff] |
679 \( # (
680 [^\\\x80-\xff\n\015()] * # normal*
681 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
682 \) # )
683 ) # special
684 [^\\\x80-\xff\n\015()] * # normal*
685 )* # )*
686 \) # )
687 [\040\t]* )* # If comment found, allow more spaces.
688 # optional leading comment
689 (?:
690 (?:
691 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
692 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
693 # Atom
694 | # or
695 " # "
696 [^\\\x80-\xff\n\015"] * # normal
697 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
698 " # "
699 # Quoted string
700 )
701 [\040\t]* # Nab whitespace.
702 (?:
703 \( # (
704 [^\\\x80-\xff\n\015()] * # normal*
705 (?: # (
706 (?: \\ [^\x80-\xff] |
707 \( # (
708 [^\\\x80-\xff\n\015()] * # normal*
709 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
710 \) # )
711 ) # special
712 [^\\\x80-\xff\n\015()] * # normal*
713 )* # )*
714 \) # )
715 [\040\t]* )* # If comment found, allow more spaces.
716 (?:
717 \.
718 [\040\t]* # Nab whitespace.
719 (?:
720 \( # (
721 [^\\\x80-\xff\n\015()] * # normal*
722 (?: # (
723 (?: \\ [^\x80-\xff] |
724 \( # (
725 [^\\\x80-\xff\n\015()] * # normal*
726 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
727 \) # )
728 ) # special
729 [^\\\x80-\xff\n\015()] * # normal*
730 )* # )*
731 \) # )
732 [\040\t]* )* # If comment found, allow more spaces.
733 (?:
734 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
735 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
736 # Atom
737 | # or
738 " # "
739 [^\\\x80-\xff\n\015"] * # normal
740 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
741 " # "
742 # Quoted string
743 )
744 [\040\t]* # Nab whitespace.
745 (?:
746 \( # (
747 [^\\\x80-\xff\n\015()] * # normal*
748 (?: # (
749 (?: \\ [^\x80-\xff] |
750 \( # (
751 [^\\\x80-\xff\n\015()] * # normal*
752 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
753 \) # )
754 ) # special
755 [^\\\x80-\xff\n\015()] * # normal*
756 )* # )*
757 \) # )
758 [\040\t]* )* # If comment found, allow more spaces.
759 # additional words
760 )*
761 @
762 [\040\t]* # Nab whitespace.
763 (?:
764 \( # (
765 [^\\\x80-\xff\n\015()] * # normal*
766 (?: # (
767 (?: \\ [^\x80-\xff] |
768 \( # (
769 [^\\\x80-\xff\n\015()] * # normal*
770 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
771 \) # )
772 ) # special
773 [^\\\x80-\xff\n\015()] * # normal*
774 )* # )*
775 \) # )
776 [\040\t]* )* # If comment found, allow more spaces.
777 (?:
778 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
779 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
780 |
781 \[ # [
782 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
783 \] # ]
784 )
785 [\040\t]* # Nab whitespace.
786 (?:
787 \( # (
788 [^\\\x80-\xff\n\015()] * # normal*
789 (?: # (
790 (?: \\ [^\x80-\xff] |
791 \( # (
792 [^\\\x80-\xff\n\015()] * # normal*
793 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
794 \) # )
795 ) # special
796 [^\\\x80-\xff\n\015()] * # normal*
797 )* # )*
798 \) # )
799 [\040\t]* )* # If comment found, allow more spaces.
800 # optional trailing comments
801 (?:
802 \.
803 [\040\t]* # Nab whitespace.
804 (?:
805 \( # (
806 [^\\\x80-\xff\n\015()] * # normal*
807 (?: # (
808 (?: \\ [^\x80-\xff] |
809 \( # (
810 [^\\\x80-\xff\n\015()] * # normal*
811 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
812 \) # )
813 ) # special
814 [^\\\x80-\xff\n\015()] * # normal*
815 )* # )*
816 \) # )
817 [\040\t]* )* # If comment found, allow more spaces.
818 (?:
819 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
820 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
821 |
822 \[ # [
823 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
824 \] # ]
825 )
826 [\040\t]* # Nab whitespace.
827 (?:
828 \( # (
829 [^\\\x80-\xff\n\015()] * # normal*
830 (?: # (
831 (?: \\ [^\x80-\xff] |
832 \( # (
833 [^\\\x80-\xff\n\015()] * # normal*
834 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
835 \) # )
836 ) # special
837 [^\\\x80-\xff\n\015()] * # normal*
838 )* # )*
839 \) # )
840 [\040\t]* )* # If comment found, allow more spaces.
841 # optional trailing comments
842 )*
843 # address
844 | # or
845 (?:
846 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
847 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
848 # Atom
849 | # or
850 " # "
851 [^\\\x80-\xff\n\015"] * # normal
852 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
853 " # "
854 # Quoted string
855 )
856 # leading word
857 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces
858 (?:
859 (?:
860 \( # (
861 [^\\\x80-\xff\n\015()] * # normal*
862 (?: # (
863 (?: \\ [^\x80-\xff] |
864 \( # (
865 [^\\\x80-\xff\n\015()] * # normal*
866 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
867 \) # )
868 ) # special
869 [^\\\x80-\xff\n\015()] * # normal*
870 )* # )*
871 \) # )
872 |
873 " # "
874 [^\\\x80-\xff\n\015"] * # normal
875 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
876 " # "
877 ) # "special" comment or quoted string
878 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal"
879 )*
880 <
881 [\040\t]* # Nab whitespace.
882 (?:
883 \( # (
884 [^\\\x80-\xff\n\015()] * # normal*
885 (?: # (
886 (?: \\ [^\x80-\xff] |
887 \( # (
888 [^\\\x80-\xff\n\015()] * # normal*
889 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
890 \) # )
891 ) # special
892 [^\\\x80-\xff\n\015()] * # normal*
893 )* # )*
894 \) # )
895 [\040\t]* )* # If comment found, allow more spaces.
896 # <
897 (?:
898 @
899 [\040\t]* # Nab whitespace.
900 (?:
901 \( # (
902 [^\\\x80-\xff\n\015()] * # normal*
903 (?: # (
904 (?: \\ [^\x80-\xff] |
905 \( # (
906 [^\\\x80-\xff\n\015()] * # normal*
907 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
908 \) # )
909 ) # special
910 [^\\\x80-\xff\n\015()] * # normal*
911 )* # )*
912 \) # )
913 [\040\t]* )* # If comment found, allow more spaces.
914 (?:
915 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
916 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
917 |
918 \[ # [
919 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
920 \] # ]
921 )
922 [\040\t]* # Nab whitespace.
923 (?:
924 \( # (
925 [^\\\x80-\xff\n\015()] * # normal*
926 (?: # (
927 (?: \\ [^\x80-\xff] |
928 \( # (
929 [^\\\x80-\xff\n\015()] * # normal*
930 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
931 \) # )
932 ) # special
933 [^\\\x80-\xff\n\015()] * # normal*
934 )* # )*
935 \) # )
936 [\040\t]* )* # If comment found, allow more spaces.
937 # optional trailing comments
938 (?:
939 \.
940 [\040\t]* # Nab whitespace.
941 (?:
942 \( # (
943 [^\\\x80-\xff\n\015()] * # normal*
944 (?: # (
945 (?: \\ [^\x80-\xff] |
946 \( # (
947 [^\\\x80-\xff\n\015()] * # normal*
948 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
949 \) # )
950 ) # special
951 [^\\\x80-\xff\n\015()] * # normal*
952 )* # )*
953 \) # )
954 [\040\t]* )* # If comment found, allow more spaces.
955 (?:
956 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
957 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
958 |
959 \[ # [
960 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
961 \] # ]
962 )
963 [\040\t]* # Nab whitespace.
964 (?:
965 \( # (
966 [^\\\x80-\xff\n\015()] * # normal*
967 (?: # (
968 (?: \\ [^\x80-\xff] |
969 \( # (
970 [^\\\x80-\xff\n\015()] * # normal*
971 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
972 \) # )
973 ) # special
974 [^\\\x80-\xff\n\015()] * # normal*
975 )* # )*
976 \) # )
977 [\040\t]* )* # If comment found, allow more spaces.
978 # optional trailing comments
979 )*
980 (?: ,
981 [\040\t]* # Nab whitespace.
982 (?:
983 \( # (
984 [^\\\x80-\xff\n\015()] * # normal*
985 (?: # (
986 (?: \\ [^\x80-\xff] |
987 \( # (
988 [^\\\x80-\xff\n\015()] * # normal*
989 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
990 \) # )
991 ) # special
992 [^\\\x80-\xff\n\015()] * # normal*
993 )* # )*
994 \) # )
995 [\040\t]* )* # If comment found, allow more spaces.
996 @
997 [\040\t]* # Nab whitespace.
998 (?:
999 \( # (
1000 [^\\\x80-\xff\n\015()] * # normal*
1001 (?: # (
1002 (?: \\ [^\x80-\xff] |
1003 \( # (
1004 [^\\\x80-\xff\n\015()] * # normal*
1005 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1006 \) # )
1007 ) # special
1008 [^\\\x80-\xff\n\015()] * # normal*
1009 )* # )*
1010 \) # )
1011 [\040\t]* )* # If comment found, allow more spaces.
1012 (?:
1013 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1014 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1015 |
1016 \[ # [
1017 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1018 \] # ]
1019 )
1020 [\040\t]* # Nab whitespace.
1021 (?:
1022 \( # (
1023 [^\\\x80-\xff\n\015()] * # normal*
1024 (?: # (
1025 (?: \\ [^\x80-\xff] |
1026 \( # (
1027 [^\\\x80-\xff\n\015()] * # normal*
1028 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1029 \) # )
1030 ) # special
1031 [^\\\x80-\xff\n\015()] * # normal*
1032 )* # )*
1033 \) # )
1034 [\040\t]* )* # If comment found, allow more spaces.
1035 # optional trailing comments
1036 (?:
1037 \.
1038 [\040\t]* # Nab whitespace.
1039 (?:
1040 \( # (
1041 [^\\\x80-\xff\n\015()] * # normal*
1042 (?: # (
1043 (?: \\ [^\x80-\xff] |
1044 \( # (
1045 [^\\\x80-\xff\n\015()] * # normal*
1046 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1047 \) # )
1048 ) # special
1049 [^\\\x80-\xff\n\015()] * # normal*
1050 )* # )*
1051 \) # )
1052 [\040\t]* )* # If comment found, allow more spaces.
1053 (?:
1054 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1055 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1056 |
1057 \[ # [
1058 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1059 \] # ]
1060 )
1061 [\040\t]* # Nab whitespace.
1062 (?:
1063 \( # (
1064 [^\\\x80-\xff\n\015()] * # normal*
1065 (?: # (
1066 (?: \\ [^\x80-\xff] |
1067 \( # (
1068 [^\\\x80-\xff\n\015()] * # normal*
1069 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1070 \) # )
1071 ) # special
1072 [^\\\x80-\xff\n\015()] * # normal*
1073 )* # )*
1074 \) # )
1075 [\040\t]* )* # If comment found, allow more spaces.
1076 # optional trailing comments
1077 )*
1078 )* # additional domains
1079 :
1080 [\040\t]* # Nab whitespace.
1081 (?:
1082 \( # (
1083 [^\\\x80-\xff\n\015()] * # normal*
1084 (?: # (
1085 (?: \\ [^\x80-\xff] |
1086 \( # (
1087 [^\\\x80-\xff\n\015()] * # normal*
1088 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1089 \) # )
1090 ) # special
1091 [^\\\x80-\xff\n\015()] * # normal*
1092 )* # )*
1093 \) # )
1094 [\040\t]* )* # If comment found, allow more spaces.
1095 # optional trailing comments
1096 )? # optional route
1097 (?:
1098 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1099 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1100 # Atom
1101 | # or
1102 " # "
1103 [^\\\x80-\xff\n\015"] * # normal
1104 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
1105 " # "
1106 # Quoted string
1107 )
1108 [\040\t]* # Nab whitespace.
1109 (?:
1110 \( # (
1111 [^\\\x80-\xff\n\015()] * # normal*
1112 (?: # (
1113 (?: \\ [^\x80-\xff] |
1114 \( # (
1115 [^\\\x80-\xff\n\015()] * # normal*
1116 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1117 \) # )
1118 ) # special
1119 [^\\\x80-\xff\n\015()] * # normal*
1120 )* # )*
1121 \) # )
1122 [\040\t]* )* # If comment found, allow more spaces.
1123 (?:
1124 \.
1125 [\040\t]* # Nab whitespace.
1126 (?:
1127 \( # (
1128 [^\\\x80-\xff\n\015()] * # normal*
1129 (?: # (
1130 (?: \\ [^\x80-\xff] |
1131 \( # (
1132 [^\\\x80-\xff\n\015()] * # normal*
1133 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1134 \) # )
1135 ) # special
1136 [^\\\x80-\xff\n\015()] * # normal*
1137 )* # )*
1138 \) # )
1139 [\040\t]* )* # If comment found, allow more spaces.
1140 (?:
1141 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1142 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1143 # Atom
1144 | # or
1145 " # "
1146 [^\\\x80-\xff\n\015"] * # normal
1147 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
1148 " # "
1149 # Quoted string
1150 )
1151 [\040\t]* # Nab whitespace.
1152 (?:
1153 \( # (
1154 [^\\\x80-\xff\n\015()] * # normal*
1155 (?: # (
1156 (?: \\ [^\x80-\xff] |
1157 \( # (
1158 [^\\\x80-\xff\n\015()] * # normal*
1159 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1160 \) # )
1161 ) # special
1162 [^\\\x80-\xff\n\015()] * # normal*
1163 )* # )*
1164 \) # )
1165 [\040\t]* )* # If comment found, allow more spaces.
1166 # additional words
1167 )*
1168 @
1169 [\040\t]* # Nab whitespace.
1170 (?:
1171 \( # (
1172 [^\\\x80-\xff\n\015()] * # normal*
1173 (?: # (
1174 (?: \\ [^\x80-\xff] |
1175 \( # (
1176 [^\\\x80-\xff\n\015()] * # normal*
1177 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1178 \) # )
1179 ) # special
1180 [^\\\x80-\xff\n\015()] * # normal*
1181 )* # )*
1182 \) # )
1183 [\040\t]* )* # If comment found, allow more spaces.
1184 (?:
1185 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1186 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1187 |
1188 \[ # [
1189 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1190 \] # ]
1191 )
1192 [\040\t]* # Nab whitespace.
1193 (?:
1194 \( # (
1195 [^\\\x80-\xff\n\015()] * # normal*
1196 (?: # (
1197 (?: \\ [^\x80-\xff] |
1198 \( # (
1199 [^\\\x80-\xff\n\015()] * # normal*
1200 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1201 \) # )
1202 ) # special
1203 [^\\\x80-\xff\n\015()] * # normal*
1204 )* # )*
1205 \) # )
1206 [\040\t]* )* # If comment found, allow more spaces.
1207 # optional trailing comments
1208 (?:
1209 \.
1210 [\040\t]* # Nab whitespace.
1211 (?:
1212 \( # (
1213 [^\\\x80-\xff\n\015()] * # normal*
1214 (?: # (
1215 (?: \\ [^\x80-\xff] |
1216 \( # (
1217 [^\\\x80-\xff\n\015()] * # normal*
1218 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1219 \) # )
1220 ) # special
1221 [^\\\x80-\xff\n\015()] * # normal*
1222 )* # )*
1223 \) # )
1224 [\040\t]* )* # If comment found, allow more spaces.
1225 (?:
1226 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
1227 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
1228 |
1229 \[ # [
1230 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
1231 \] # ]
1232 )
1233 [\040\t]* # Nab whitespace.
1234 (?:
1235 \( # (
1236 [^\\\x80-\xff\n\015()] * # normal*
1237 (?: # (
1238 (?: \\ [^\x80-\xff] |
1239 \( # (
1240 [^\\\x80-\xff\n\015()] * # normal*
1241 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
1242 \) # )
1243 ) # special
1244 [^\\\x80-\xff\n\015()] * # normal*
1245 )* # )*
1246 \) # )
1247 [\040\t]* )* # If comment found, allow more spaces.
1248 # optional trailing comments
1249 )*
1250 # address spec
1251 > # >
1252 # name and address
1253 )
1254 /x
1255 Alan Other <user\@dom.ain>
1256 <user\@dom.ain>
1257 user\@dom.ain
1258 \"A. Other\" <user.1234\@dom.ain> (a comment)
1259 A. Other <user.1234\@dom.ain> (a comment)
1260 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
1261 A missing angle <user\@some.where
1262 *** Failers
1263 The quick brown fox
1264
1265 /abc\0def\00pqr\000xyz\0000AB/
1266 abc\0def\00pqr\000xyz\0000AB
1267 abc456 abc\0def\00pqr\000xyz\0000ABCDE
1268
1269 /abc\x0def\x00pqr\x000xyz\x0000AB/
1270 abc\x0def\x00pqr\x000xyz\x0000AB
1271 abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE
1272
1273 /^[\000-\037]/
1274 \0A
1275 \01B
1276 \037C
1277
1278 /\0*/
1279 \0\0\0\0
1280
1281 /A\x0{2,3}Z/
1282 The A\x0\x0Z
1283 An A\0\x0\0Z
1284 *** Failers
1285 A\0Z
1286 A\0\x0\0\x0Z
1287
1288 /^(cow|)\1(bell)/
1289 cowcowbell
1290 bell
1291 *** Failers
1292 cowbell
1293
1294 /^\s/
1295 \040abc
1296 \x0cabc
1297 \nabc
1298 \rabc
1299 \tabc
1300 *** Failers
1301 abc
1302
1303 /^a b
1304 c/x
1305 abc
1306
1307 /^(a|)\1*b/
1308 ab
1309 aaaab
1310 b
1311 *** Failers
1312 acb
1313
1314 /^(a|)\1+b/
1315 aab
1316 aaaab
1317 b
1318 *** Failers
1319 ab
1320
1321 /^(a|)\1?b/
1322 ab
1323 aab
1324 b
1325 *** Failers
1326 acb
1327
1328 /^(a|)\1{2}b/
1329 aaab
1330 b
1331 *** Failers
1332 ab
1333 aab
1334 aaaab
1335
1336 /^(a|)\1{2,3}b/
1337 aaab
1338 aaaab
1339 b
1340 *** Failers
1341 ab
1342 aab
1343 aaaaab
1344
1345 /ab{1,3}bc/
1346 abbbbc
1347 abbbc
1348 abbc
1349 *** Failers
1350 abc
1351 abbbbbc
1352
1353 /([^.]*)\.([^:]*):[T ]+(.*)/
1354 track1.title:TBlah blah blah
1355
1356 /([^.]*)\.([^:]*):[T ]+(.*)/i
1357 track1.title:TBlah blah blah
1358
1359 /([^.]*)\.([^:]*):[t ]+(.*)/i
1360 track1.title:TBlah blah blah
1361
1362 /^[W-c]+$/
1363 WXY_^abc
1364 *** Failers
1365 wxy
1366
1367 /^[W-c]+$/i
1368 WXY_^abc
1369 wxy_^ABC
1370
1371 /^[\x3f-\x5F]+$/i
1372 WXY_^abc
1373 wxy_^ABC
1374
1375 /^abc$/m
1376 abc
1377 qqq\nabc
1378 abc\nzzz
1379 qqq\nabc\nzzz
1380
1381 /^abc$/
1382 abc
1383 *** Failers
1384 qqq\nabc
1385 abc\nzzz
1386 qqq\nabc\nzzz
1387
1388 /\Aabc\Z/m
1389 abc
1390 abc\n
1391 *** Failers
1392 qqq\nabc
1393 abc\nzzz
1394 qqq\nabc\nzzz
1395
1396 /\A(.)*\Z/s
1397 abc\ndef
1398
1399 /\A(.)*\Z/m
1400 *** Failers
1401 abc\ndef
1402
1403 /(?:b)|(?::+)/
1404 b::c
1405 c::b
1406
1407 /[-az]+/
1408 az-
1409 *** Failers
1410 b
1411
1412 /[az-]+/
1413 za-
1414 *** Failers
1415 b
1416
1417 /[a\-z]+/
1418 a-z
1419 *** Failers
1420 b
1421
1422 /[a-z]+/
1423 abcdxyz
1424
1425 /[\d-]+/
1426 12-34
1427 *** Failers
1428 aaa
1429
1430 /[\d-z]+/
1431 12-34z
1432 *** Failers
1433 aaa
1434
1435 /\x5c/
1436 \\
1437
1438 /\x20Z/
1439 the Zoo
1440 *** Failers
1441 Zulu
1442
1443 /(abc)\1/i
1444 abcabc
1445 ABCabc
1446 abcABC
1447
1448 /ab{3cd/
1449 ab{3cd
1450
1451 /ab{3,cd/
1452 ab{3,cd
1453
1454 /ab{3,4a}cd/
1455 ab{3,4a}cd
1456
1457 /{4,5a}bc/
1458 {4,5a}bc
1459
1460 /abc$/
1461 abc
1462 abc\n
1463 *** Failers
1464 abc\ndef
1465
1466 /(abc)\123/
1467 abc\x53
1468
1469 /(abc)\223/
1470 abc\x93
1471
1472 /(abc)\323/
1473 abc\xd3
1474
1475 /(abc)\100/
1476 abc\x40
1477 abc\100
1478
1479 /(abc)\1000/
1480 abc\x400
1481 abc\x40\x30
1482 abc\1000
1483 abc\100\x30
1484 abc\100\060
1485 abc\100\60
1486
1487 /^A\8B\9C$/
1488 A8B9C
1489 *** Failers
1490 A\08B\09C
1491
1492 /^(A)(B)(C)(D)(E)(F)(G)(H)(I)\8\9$/
1493 ABCDEFGHIHI
1494
1495 /^[A\8B\9C]+$/
1496 A8B9C
1497 *** Failers
1498 A8B9C\x00
1499
1500 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/
1501 abcdefghijkllS
1502
1503 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
1504 abcdefghijk\12S
1505
1506 /ab\idef/
1507 abidef
1508
1509 /a{0}bc/
1510 bc
1511
1512 /(a|(bc)){0,0}?xyz/
1513 xyz
1514
1515 /abc[\10]de/
1516 abc\010de
1517
1518 /abc[\1]de/
1519 abc\1de
1520
1521 /(abc)[\1]de/
1522 abc\1de
1523
1524 /(?s)a.b/
1525 a\nb
1526
1527 /^([^a])([^\b])([^c]*)([^d]{3,4})/
1528 baNOTccccd
1529 baNOTcccd
1530 baNOTccd
1531 bacccd
1532 *** Failers
1533 anything
1534 b\bc
1535 baccd
1536
1537 /[^a]/
1538 Abc
1539
1540 /[^a]/i
1541 Abc
1542
1543 /[^a]+/
1544 AAAaAbc
1545
1546 /[^a]+/i
1547 AAAaAbc
1548
1549 /[^a]+/
1550 bbb\nccc
1551
1552 /[^k]$/
1553 abc
1554 *** Failers
1555 abk
1556
1557 /[^k]{2,3}$/
1558 abc
1559 kbc
1560 kabc
1561 *** Failers
1562 abk
1563 akb
1564 akk
1565
1566 /^\d{8,}\@.+[^k]$/
1567 12345678\@a.b.c.d
1568 123456789\@x.y.z
1569 *** Failers
1570 12345678\@x.y.uk
1571 1234567\@a.b.c.d
1572
1573 /(a)\1{8,}/
1574 aaaaaaaaa
1575 aaaaaaaaaa
1576 *** Failers
1577 aaaaaaa
1578
1579 /[^a]/
1580 aaaabcd
1581 aaAabcd
1582
1583 /[^a]/i
1584 aaaabcd
1585 aaAabcd
1586
1587 /[^az]/
1588 aaaabcd
1589 aaAabcd
1590
1591 /[^az]/i
1592 aaaabcd
1593 aaAabcd
1594
1595 /\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/
1596 \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
1597
1598 /P[^*]TAIRE[^*]{1,6}?LL/
1599 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
1600
1601 /P[^*]TAIRE[^*]{1,}?LL/
1602 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
1603
1604 /(\.\d\d[1-9]?)\d+/
1605 1.230003938
1606 1.875000282
1607 1.235
1608
1609 /(\.\d\d((?=0)|\d(?=\d)))/
1610 1.230003938
1611 1.875000282
1612 *** Failers
1613 1.235
1614
1615 /a(?)b/
1616 ab
1617
1618 /\b(foo)\s+(\w+)/i
1619 Food is on the foo table
1620
1621 /foo(.*)bar/
1622 The food is under the bar in the barn.
1623
1624 /foo(.*?)bar/
1625 The food is under the bar in the barn.
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 /(.*)(\d+)$/
1640 I have 2 numbers: 53147
1641
1642 /(.*?)(\d+)$/
1643 I have 2 numbers: 53147
1644
1645 /(.*)\b(\d+)$/
1646 I have 2 numbers: 53147
1647
1648 /(.*\D)(\d+)$/
1649 I have 2 numbers: 53147
1650
1651 /^\D*(?!123)/
1652 ABC123
1653
1654 /^(\D*)(?=\d)(?!123)/
1655 ABC445
1656 *** Failers
1657 ABC123
1658
1659 /^[W-]46]/
1660 W46]789
1661 -46]789
1662 *** Failers
1663 Wall
1664 Zebra
1665 42
1666 [abcd]
1667 ]abcd[
1668
1669 /^[W-\]46]/
1670 W46]789
1671 Wall
1672 Zebra
1673 Xylophone
1674 42
1675 [abcd]
1676 ]abcd[
1677 \\backslash
1678 *** Failers
1679 -46]789
1680 well
1681
1682 /\d\d\/\d\d\/\d\d\d\d/
1683 01/01/2000
1684
1685 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
1686 word cat dog elephant mussel cow horse canary baboon snake shark otherword
1687 word cat dog elephant mussel cow horse canary baboon snake shark
1688
1689 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
1690 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
1691
1692 /^(a){0,0}/
1693 bcd
1694 abc
1695 aab
1696
1697 /^(a){0,1}/
1698 bcd
1699 abc
1700 aab
1701
1702 /^(a){0,2}/
1703 bcd
1704 abc
1705 aab
1706
1707 /^(a){0,3}/
1708 bcd
1709 abc
1710 aab
1711 aaa
1712
1713 /^(a){0,}/
1714 bcd
1715 abc
1716 aab
1717 aaa
1718 aaaaaaaa
1719
1720 /^(a){1,1}/
1721 bcd
1722 abc
1723 aab
1724
1725 /^(a){1,2}/
1726 bcd
1727 abc
1728 aab
1729
1730 /^(a){1,3}/
1731 bcd
1732 abc
1733 aab
1734 aaa
1735
1736 /^(a){1,}/
1737 bcd
1738 abc
1739 aab
1740 aaa
1741 aaaaaaaa
1742
1743 /.*\.gif/
1744 borfle\nbib.gif\nno
1745
1746 /.{0,}\.gif/
1747 borfle\nbib.gif\nno
1748
1749 /.*\.gif/m
1750 borfle\nbib.gif\nno
1751
1752 /.*\.gif/s
1753 borfle\nbib.gif\nno
1754
1755 /.*\.gif/ms
1756 borfle\nbib.gif\nno
1757
1758 /.*$/
1759 borfle\nbib.gif\nno
1760
1761 /.*$/m
1762 borfle\nbib.gif\nno
1763
1764 /.*$/s
1765 borfle\nbib.gif\nno
1766
1767 /.*$/ms
1768 borfle\nbib.gif\nno
1769
1770 /.*$/
1771 borfle\nbib.gif\nno\n
1772
1773 /.*$/m
1774 borfle\nbib.gif\nno\n
1775
1776 /.*$/s
1777 borfle\nbib.gif\nno\n
1778
1779 /.*$/ms
1780 borfle\nbib.gif\nno\n
1781
1782 /(.*X|^B)/
1783 abcde\n1234Xyz
1784 BarFoo
1785 *** Failers
1786 abcde\nBar
1787
1788 /(.*X|^B)/m
1789 abcde\n1234Xyz
1790 BarFoo
1791 abcde\nBar
1792
1793 /(.*X|^B)/s
1794 abcde\n1234Xyz
1795 BarFoo
1796 *** Failers
1797 abcde\nBar
1798
1799 /(.*X|^B)/ms
1800 abcde\n1234Xyz
1801 BarFoo
1802 abcde\nBar
1803
1804 /(?s)(.*X|^B)/
1805 abcde\n1234Xyz
1806 BarFoo
1807 *** Failers
1808 abcde\nBar
1809
1810 /(?s:.*X|^B)/
1811 abcde\n1234Xyz
1812 BarFoo
1813 *** Failers
1814 abcde\nBar
1815
1816 /^.*B/
1817 **** Failers
1818 abc\nB
1819
1820 /(?s)^.*B/
1821 abc\nB
1822
1823 /(?m)^.*B/
1824 abc\nB
1825
1826 /(?ms)^.*B/
1827 abc\nB
1828
1829 /(?ms)^B/
1830 abc\nB
1831
1832 /(?s)B$/
1833 B\n
1834
1835 /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
1836 123456654321
1837
1838 /^\d\d\d\d\d\d\d\d\d\d\d\d/
1839 123456654321
1840
1841 /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
1842 123456654321
1843
1844 /^[abc]{12}/
1845 abcabcabcabc
1846
1847 /^[a-c]{12}/
1848 abcabcabcabc
1849
1850 /^(a|b|c){12}/
1851 abcabcabcabc
1852
1853 /^[abcdefghijklmnopqrstuvwxy0123456789]/
1854 n
1855 *** Failers
1856 z
1857
1858 /abcde{0,0}/
1859 abcd
1860 *** Failers
1861 abce
1862
1863 /ab[cd]{0,0}e/
1864 abe
1865 *** Failers
1866 abcde
1867
1868 /ab(c){0,0}d/
1869 abd
1870 *** Failers
1871 abcd
1872
1873 /a(b*)/
1874 a
1875 ab
1876 abbbb
1877 *** Failers
1878 bbbbb
1879
1880 /ab\d{0}e/
1881 abe
1882 *** Failers
1883 ab1e
1884
1885 /"([^\\"]+|\\.)*"/
1886 the \"quick\" brown fox
1887 \"the \\\"quick\\\" brown fox\"
1888
1889 /.*?/g+
1890 abc
1891
1892 /\b/g+
1893 abc
1894
1895 /\b/+g
1896 abc
1897
1898 //g
1899 abc
1900
1901 /<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
1902 <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>
1903
1904 /a[^a]b/
1905 acb
1906 a\nb
1907
1908 /a.b/
1909 acb
1910 *** Failers
1911 a\nb
1912
1913 /a[^a]b/s
1914 acb
1915 a\nb
1916
1917 /a.b/s
1918 acb
1919 a\nb
1920
1921 /^(b+?|a){1,2}?c/
1922 bac
1923 bbac
1924 bbbac
1925 bbbbac
1926 bbbbbac
1927
1928 /^(b+|a){1,2}?c/
1929 bac
1930 bbac
1931 bbbac
1932 bbbbac
1933 bbbbbac
1934
1935 /(?!\A)x/m
1936 x\nb\n
1937 a\bx\n
1938
1939 /\x0{ab}/
1940 \0{ab}
1941
1942 /(A|B)*?CD/
1943 CD
1944
1945 /(A|B)*CD/
1946 CD
1947
1948 /(AB)*?\1/
1949 ABABAB
1950
1951 /(AB)*\1/
1952 ABABAB
1953
1954 /(?<!bar)foo/
1955 foo
1956 catfood
1957 arfootle
1958 rfoosh
1959 *** Failers
1960 barfoo
1961 towbarfoo
1962
1963 /\w{3}(?<!bar)foo/
1964 catfood
1965 *** Failers
1966 foo
1967 barfoo
1968 towbarfoo
1969
1970 /(?<=(foo)a)bar/
1971 fooabar
1972 *** Failers
1973 bar
1974 foobbar
1975
1976 /\Aabc\z/m
1977 abc
1978 *** Failers
1979 abc\n
1980 qqq\nabc
1981 abc\nzzz
1982 qqq\nabc\nzzz
1983
1984 "(?>.*/)foo"
1985 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
1986
1987 "(?>.*/)foo"
1988 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
1989
1990 /(?>(\.\d\d[1-9]?))\d+/
1991 1.230003938
1992 1.875000282
1993 *** Failers
1994 1.235
1995
1996 /^((?>\w+)|(?>\s+))*$/
1997 now is the time for all good men to come to the aid of the party
1998 *** Failers
1999 this is not a line with only words and spaces!
2000
2001 /(\d+)(\w)/
2002 12345a
2003 12345+
2004
2005 /((?>\d+))(\w)/
2006 12345a
2007 *** Failers
2008 12345+
2009
2010 /(?>a+)b/
2011 aaab
2012
2013 /((?>a+)b)/
2014 aaab
2015
2016 /(?>(a+))b/
2017 aaab
2018
2019 /(?>b)+/
2020 aaabbbccc
2021
2022 /(?>a+|b+|c+)*c/
2023 aaabbbbccccd
2024
2025 /((?>[^()]+)|\([^()]*\))+/
2026 ((abc(ade)ufh()()x
2027
2028 /\(((?>[^()]+)|\([^()]+\))+\)/
2029 (abc)
2030 (abc(def)xyz)
2031 *** Failers
2032 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2033
2034 /a(?-i)b/i
2035 ab
2036 Ab
2037 *** Failers
2038 aB
2039 AB
2040
2041 /(a (?x)b c)d e/
2042 a bcd e
2043 *** Failers
2044 a b cd e
2045 abcd e
2046 a bcde
2047
2048 /(a b(?x)c d (?-x)e f)/
2049 a bcde f
2050 *** Failers
2051 abcdef
2052
2053 /(a(?i)b)c/
2054 abc
2055 aBc
2056 *** Failers
2057 abC
2058 aBC
2059 Abc
2060 ABc
2061 ABC
2062 AbC
2063
2064 /a(?i:b)c/
2065 abc
2066 aBc
2067 *** Failers
2068 ABC
2069 abC
2070 aBC
2071
2072 /a(?i:b)*c/
2073 aBc
2074 aBBc
2075 *** Failers
2076 aBC
2077 aBBC
2078
2079 /a(?=b(?i)c)\w\wd/
2080 abcd
2081 abCd
2082 *** Failers
2083 aBCd
2084 abcD
2085
2086 /(?s-i:more.*than).*million/i
2087 more than million
2088 more than MILLION
2089 more \n than Million
2090 *** Failers
2091 MORE THAN MILLION
2092 more \n than \n million
2093
2094 /(?:(?s-i)more.*than).*million/i
2095 more than million
2096 more than MILLION
2097 more \n than Million
2098 *** Failers
2099 MORE THAN MILLION
2100 more \n than \n million
2101
2102 /(?>a(?i)b+)+c/
2103 abc
2104 aBbc
2105 aBBc
2106 *** Failers
2107 Abc
2108 abAb
2109 abbC
2110
2111 /(?=a(?i)b)\w\wc/
2112 abc
2113 aBc
2114 *** Failers
2115 Ab
2116 abC
2117 aBC
2118
2119 /(?<=a(?i)b)(\w\w)c/
2120 abxxc
2121 aBxxc
2122 *** Failers
2123 Abxxc
2124 ABxxc
2125 abxxC
2126
2127 /(?:(a)|b)(?(1)A|B)/
2128 aA
2129 bB
2130 *** Failers
2131 aB
2132 bA
2133
2134 /^(a)?(?(1)a|b)+$/
2135 aa
2136 b
2137 bb
2138 *** Failers
2139 ab
2140
2141 /^(?(?=abc)\w{3}:|\d\d)$/
2142 abc:
2143 12
2144 *** Failers
2145 123
2146 xyz
2147
2148 /^(?(?!abc)\d\d|\w{3}:)$/
2149 abc:
2150 12
2151 *** Failers
2152 123
2153 xyz
2154
2155 /(?(?<=foo)bar|cat)/
2156 foobar
2157 cat
2158 fcat
2159 focat
2160 *** Failers
2161 foocat
2162
2163 /(?(?<!foo)cat|bar)/
2164 foobar
2165 cat
2166 fcat
2167 focat
2168 *** Failers
2169 foocat
2170
2171 /( \( )? [^()]+ (?(1) \) |) /x
2172 abcd
2173 (abcd)
2174 the quick (abcd) fox
2175 (abcd
2176
2177 /( \( )? [^()]+ (?(1) \) ) /x
2178 abcd
2179 (abcd)
2180 the quick (abcd) fox
2181 (abcd
2182
2183 /^(?(2)a|(1)(2))+$/
2184 12
2185 12a
2186 12aa
2187 *** Failers
2188 1234
2189
2190 /((?i)blah)\s+\1/
2191 blah blah
2192 BLAH BLAH
2193 Blah Blah
2194 blaH blaH
2195 *** Failers
2196 blah BLAH
2197 Blah blah
2198 blaH blah
2199
2200 /((?i)blah)\s+(?i:\1)/
2201 blah blah
2202 BLAH BLAH
2203 Blah Blah
2204 blaH blaH
2205 blah BLAH
2206 Blah blah
2207 blaH blah
2208
2209 /(?>a*)*/
2210 a
2211 aa
2212 aaaa
2213
2214 /(abc|)+/
2215 abc
2216 abcabc
2217 abcabcabc
2218 xyz
2219
2220 /([a]*)*/
2221 a
2222 aaaaa
2223
2224 /([ab]*)*/
2225 a
2226 b
2227 ababab
2228 aaaabcde
2229 bbbb
2230
2231 /([^a]*)*/
2232 b
2233 bbbb
2234 aaa
2235
2236 /([^ab]*)*/
2237 cccc
2238 abab
2239
2240 /([a]*?)*/
2241 a
2242 aaaa
2243
2244 /([ab]*?)*/
2245 a
2246 b
2247 abab
2248 baba
2249
2250 /([^a]*?)*/
2251 b
2252 bbbb
2253 aaa
2254
2255 /([^ab]*?)*/
2256 c
2257 cccc
2258 baba
2259
2260 /(?>a*)*/
2261 a
2262 aaabcde
2263
2264 /((?>a*))*/
2265 aaaaa
2266 aabbaa
2267
2268 /((?>a*?))*/
2269 aaaaa
2270 aabbaa
2271
2272 /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
2273 12-sep-98
2274 12-09-98
2275 *** Failers
2276 sep-12-98
2277
2278 /(?<=(foo))bar\1/
2279 foobarfoo
2280 foobarfootling
2281 *** Failers
2282 foobar
2283 barfoo
2284
2285 /(?i:saturday|sunday)/
2286 saturday
2287 sunday
2288 Saturday
2289 Sunday
2290 SATURDAY
2291 SUNDAY
2292 SunDay
2293
2294 /(a(?i)bc|BB)x/
2295 abcx
2296 aBCx
2297 bbx
2298 BBx
2299 *** Failers
2300 abcX
2301 aBCX
2302 bbX
2303 BBX
2304
2305 /^([ab](?i)[cd]|[ef])/
2306 ac
2307 aC
2308 bD
2309 elephant
2310 Europe
2311 frog
2312 France
2313 *** Failers
2314 Africa
2315
2316 /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
2317 ab
2318 aBd
2319 xy
2320 xY
2321 zebra
2322 Zambesi
2323 *** Failers
2324 aCD
2325 XY
2326
2327 /(?<=foo\n)^bar/m
2328 foo\nbar
2329 *** Failers
2330 bar
2331 baz\nbar
2332
2333 /(?<=(?<!foo)bar)baz/
2334 barbaz
2335 barbarbaz
2336 koobarbaz
2337 *** Failers
2338 baz
2339 foobarbaz
2340
2341 /The cases of aaaa and aaaaaa are missed out below because Perl does things/
2342 /differently. We know that odd, and maybe incorrect, things happen with/
2343 /recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./
2344
2345 /^(a\1?){4}$/
2346 a
2347 aa
2348 aaa
2349 aaaaa
2350 aaaaaaa
2351 aaaaaaaa
2352 aaaaaaaaa
2353 aaaaaaaaaa
2354 aaaaaaaaaaa
2355 aaaaaaaaaaaa
2356 aaaaaaaaaaaaa
2357 aaaaaaaaaaaaaa
2358 aaaaaaaaaaaaaaa
2359 aaaaaaaaaaaaaaaa
2360
2361 /^(a\1?)(a\1?)(a\2?)(a\3?)$/
2362 a
2363 aa
2364 aaa
2365 aaaa
2366 aaaaa
2367 aaaaaa
2368 aaaaaaa
2369 aaaaaaaa
2370 aaaaaaaaa
2371 aaaaaaaaaa
2372 aaaaaaaaaaa
2373 aaaaaaaaaaaa
2374 aaaaaaaaaaaaa
2375 aaaaaaaaaaaaaa
2376 aaaaaaaaaaaaaaa
2377 aaaaaaaaaaaaaaaa
2378
2379 /The following tests are taken from the Perl 5.005 test suite; some of them/
2380 /are compatible with 5.004, but I'd rather not have to sort them out./
2381
2382 /abc/
2383 abc
2384 xabcy
2385 ababc
2386 *** Failers
2387 xbc
2388 axc
2389 abx
2390
2391 /ab*c/
2392 abc
2393
2394 /ab*bc/
2395 abc
2396 abbc
2397 abbbbc
2398
2399 /.{1}/
2400 abbbbc
2401
2402 /.{3,4}/
2403 abbbbc
2404
2405 /ab{0,}bc/
2406 abbbbc
2407
2408 /ab+bc/
2409 abbc
2410 *** Failers
2411 abc
2412 abq
2413
2414 /ab{1,}bc/
2415
2416 /ab+bc/
2417 abbbbc
2418
2419 /ab{1,}bc/
2420 abbbbc
2421
2422 /ab{1,3}bc/
2423 abbbbc
2424
2425 /ab{3,4}bc/
2426 abbbbc
2427
2428 /ab{4,5}bc/
2429 *** Failers
2430 abq
2431 abbbbc
2432
2433 /ab?bc/
2434 abbc
2435 abc
2436
2437 /ab{0,1}bc/
2438 abc
2439
2440 /ab?bc/
2441
2442 /ab?c/
2443 abc
2444
2445 /ab{0,1}c/
2446 abc
2447
2448 /^abc$/
2449 abc
2450 *** Failers
2451 abbbbc
2452 abcc
2453
2454 /^abc/
2455 abcc
2456
2457 /^abc$/
2458
2459 /abc$/
2460 aabc
2461 *** Failers
2462 aabc
2463 aabcd
2464
2465 /^/
2466 abc
2467
2468 /$/
2469 abc
2470
2471 /a.c/
2472 abc
2473 axc
2474
2475 /a.*c/
2476 axyzc
2477
2478 /a[bc]d/
2479 abd
2480 *** Failers
2481 axyzd
2482 abc
2483
2484 /a[b-d]e/
2485 ace
2486
2487 /a[b-d]/
2488 aac
2489
2490 /a[-b]/
2491 a-
2492
2493 /a[b-]/
2494 a-
2495
2496 /a]/
2497 a]
2498
2499 /a[]]b/
2500 a]b
2501
2502 /a[^bc]d/
2503 aed
2504 *** Failers
2505 abd
2506 abd
2507
2508 /a[^-b]c/
2509 adc
2510
2511 /a[^]b]c/
2512 adc
2513 *** Failers
2514 a-c
2515 a]c
2516
2517 /\ba\b/
2518 a-
2519 -a
2520 -a-
2521
2522 /\by\b/
2523 *** Failers
2524 xy
2525 yz
2526 xyz
2527
2528 /\Ba\B/
2529 *** Failers
2530 a-
2531 -a
2532 -a-
2533
2534 /\By\b/
2535 xy
2536
2537 /\by\B/
2538 yz
2539
2540 /\By\B/
2541 xyz
2542
2543 /\w/
2544 a
2545
2546 /\W/
2547 -
2548 *** Failers
2549 -
2550 a
2551
2552 /a\sb/
2553 a b
2554
2555 /a\Sb/
2556 a-b
2557 *** Failers
2558 a-b
2559 a b
2560
2561 /\d/
2562 1
2563
2564 /\D/
2565 -
2566 *** Failers
2567 -
2568 1
2569
2570 /[\w]/
2571 a
2572
2573 /[\W]/
2574 -
2575 *** Failers
2576 -
2577 a
2578
2579 /a[\s]b/
2580 a b
2581
2582 /a[\S]b/
2583 a-b
2584 *** Failers
2585 a-b
2586 a b
2587
2588 /[\d]/
2589 1
2590
2591 /[\D]/
2592 -
2593 *** Failers
2594 -
2595 1
2596
2597 /ab|cd/
2598 abc
2599 abcd
2600
2601 /()ef/
2602 def
2603
2604 /$b/
2605
2606 /a\(b/
2607 a(b
2608
2609 /a\(*b/
2610 ab
2611 a((b
2612
2613 /a\\b/
2614 a\b
2615
2616 /((a))/
2617 abc
2618
2619 /(a)b(c)/
2620 abc
2621
2622 /a+b+c/
2623 aabbabc
2624
2625 /a{1,}b{1,}c/
2626 aabbabc
2627
2628 /a.+?c/
2629 abcabc
2630
2631 /(a+|b)*/
2632 ab
2633
2634 /(a+|b){0,}/
2635 ab
2636
2637 /(a+|b)+/
2638 ab
2639
2640 /(a+|b){1,}/
2641 ab
2642
2643 /(a+|b)?/
2644 ab
2645
2646 /(a+|b){0,1}/
2647 ab
2648
2649 /[^ab]*/
2650 cde
2651
2652 /abc/
2653 *** Failers
2654 b
2655
2656
2657 /a*/
2658
2659
2660 /([abc])*d/
2661 abbbcd
2662
2663 /([abc])*bcd/
2664 abcd
2665
2666 /a|b|c|d|e/
2667 e
2668
2669 /(a|b|c|d|e)f/
2670 ef
2671
2672 /abcd*efg/
2673 abcdefg
2674
2675 /ab*/
2676 xabyabbbz
2677 xayabbbz
2678
2679 /(ab|cd)e/
2680 abcde
2681
2682 /[abhgefdc]ij/
2683 hij
2684
2685 /^(ab|cd)e/
2686
2687 /(abc|)ef/
2688 abcdef
2689
2690 /(a|b)c*d/
2691 abcd
2692
2693 /(ab|ab*)bc/
2694 abc
2695
2696 /a([bc]*)c*/
2697 abc
2698
2699 /a([bc]*)(c*d)/
2700 abcd
2701
2702 /a([bc]+)(c*d)/
2703 abcd
2704
2705 /a([bc]*)(c+d)/
2706 abcd
2707
2708 /a[bcd]*dcdcde/
2709 adcdcde
2710
2711 /a[bcd]+dcdcde/
2712 *** Failers
2713 abcde
2714 adcdcde
2715
2716 /(ab|a)b*c/
2717 abc
2718
2719 /((a)(b)c)(d)/
2720 abcd
2721
2722 /[a-zA-Z_][a-zA-Z0-9_]*/
2723 alpha
2724
2725 /^a(bc+|b[eh])g|.h$/
2726 abh
2727
2728 /(bc+d$|ef*g.|h?i(j|k))/
2729 effgz
2730 ij
2731 reffgz
2732 *** Failers
2733 effg
2734 bcdd
2735
2736 /((((((((((a))))))))))/
2737 a
2738
2739 /((((((((((a))))))))))\10/
2740 aa
2741
2742 /(((((((((a)))))))))/
2743 a
2744
2745 /multiple words of text/
2746 *** Failers
2747 aa
2748 uh-uh
2749
2750 /multiple words/
2751 multiple words, yeah
2752
2753 /(.*)c(.*)/
2754 abcde
2755
2756 /\((.*), (.*)\)/
2757 (a, b)
2758
2759 /[k]/
2760
2761 /abcd/
2762 abcd
2763
2764 /a(bc)d/
2765 abcd
2766
2767 /a[-]?c/
2768 ac
2769
2770 /(abc)\1/
2771 abcabc
2772
2773 /([a-c]*)\1/
2774 abcabc
2775
2776 /(a)|\1/
2777 a
2778 *** Failers
2779 ab
2780 x
2781
2782 /(([a-c])b*?\2)*/
2783 ababbbcbc
2784
2785 /(([a-c])b*?\2){3}/
2786 ababbbcbc
2787
2788 /((\3|b)\2(a)x)+/
2789 aaaxabaxbaaxbbax
2790
2791 /((\3|b)\2(a)){2,}/
2792 bbaababbabaaaaabbaaaabba
2793
2794 /abc/i
2795 ABC
2796 XABCY
2797 ABABC
2798 *** Failers
2799 aaxabxbaxbbx
2800 XBC
2801 AXC
2802 ABX
2803
2804 /ab*c/i
2805 ABC
2806
2807 /ab*bc/i
2808 ABC
2809 ABBC
2810
2811 /ab*?bc/i
2812 ABBBBC
2813
2814 /ab{0,}?bc/i
2815 ABBBBC
2816
2817 /ab+?bc/i
2818 ABBC
2819
2820 /ab+bc/i
2821 *** Failers
2822 ABC
2823 ABQ
2824
2825 /ab{1,}bc/i
2826
2827 /ab+bc/i
2828 ABBBBC
2829
2830 /ab{1,}?bc/i
2831 ABBBBC
2832
2833 /ab{1,3}?bc/i
2834 ABBBBC
2835
2836 /ab{3,4}?bc/i
2837 ABBBBC
2838
2839 /ab{4,5}?bc/i
2840 *** Failers
2841 ABQ
2842 ABBBBC
2843
2844 /ab??bc/i
2845 ABBC
2846 ABC
2847
2848 /ab{0,1}?bc/i
2849 ABC
2850
2851 /ab??bc/i
2852
2853 /ab??c/i
2854 ABC
2855
2856 /ab{0,1}?c/i
2857 ABC
2858
2859 /^abc$/i
2860 ABC
2861 *** Failers
2862 ABBBBC
2863 ABCC
2864
2865 /^abc/i
2866 ABCC
2867
2868 /^abc$/i
2869
2870 /abc$/i
2871 AABC
2872
2873 /^/i
2874 ABC
2875
2876 /$/i
2877 ABC
2878
2879 /a.c/i
2880 ABC
2881 AXC
2882
2883 /a.*?c/i
2884 AXYZC
2885
2886 /a.*c/i
2887 *** Failers
2888 AABC
2889 AXYZD
2890
2891 /a[bc]d/i
2892 ABD
2893
2894 /a[b-d]e/i
2895 ACE
2896 *** Failers
2897 ABC
2898 ABD
2899
2900 /a[b-d]/i
2901 AAC
2902
2903 /a[-b]/i
2904 A-
2905
2906 /a[b-]/i
2907 A-
2908
2909 /a]/i
2910 A]
2911
2912 /a[]]b/i
2913 A]B
2914
2915 /a[^bc]d/i
2916 AED
2917
2918 /a[^-b]c/i
2919 ADC
2920 *** Failers
2921 ABD
2922 A-C
2923
2924 /a[^]b]c/i
2925 ADC
2926
2927 /ab|cd/i
2928 ABC
2929 ABCD
2930
2931 /()ef/i
2932 DEF
2933
2934 /$b/i
2935 *** Failers
2936 A]C
2937 B
2938
2939 /a\(b/i
2940 A(B
2941
2942 /a\(*b/i
2943 AB
2944 A((B
2945
2946 /a\\b/i
2947 A\B
2948
2949 /((a))/i
2950 ABC
2951
2952 /(a)b(c)/i
2953 ABC
2954
2955 /a+b+c/i
2956 AABBABC
2957
2958 /a{1,}b{1,}c/i
2959 AABBABC
2960
2961 /a.+?c/i
2962 ABCABC
2963
2964 /a.*?c/i
2965 ABCABC
2966
2967 /a.{0,5}?c/i
2968 ABCABC
2969
2970 /(a+|b)*/i
2971 AB
2972
2973 /(a+|b){0,}/i
2974 AB
2975
2976 /(a+|b)+/i
2977 AB
2978
2979 /(a+|b){1,}/i
2980 AB
2981
2982 /(a+|b)?/i
2983 AB
2984
2985 /(a+|b){0,1}/i
2986 AB
2987
2988 /(a+|b){0,1}?/i
2989 AB
2990
2991 /[^ab]*/i
2992 CDE
2993
2994 /abc/i
2995
2996 /a*/i
2997
2998
2999 /([abc])*d/i
3000 ABBBCD
3001
3002 /([abc])*bcd/i
3003 ABCD
3004
3005 /a|b|c|d|e/i
3006 E
3007
3008 /(a|b|c|d|e)f/i
3009 EF
3010
3011 /abcd*efg/i
3012 ABCDEFG
3013
3014 /ab*/i
3015 XABYABBBZ
3016 XAYABBBZ
3017
3018 /(ab|cd)e/i
3019 ABCDE
3020
3021 /[abhgefdc]ij/i
3022 HIJ
3023
3024 /^(ab|cd)e/i
3025 ABCDE
3026
3027 /(abc|)ef/i
3028 ABCDEF
3029
3030 /(a|b)c*d/i
3031 ABCD
3032
3033 /(ab|ab*)bc/i
3034 ABC
3035
3036 /a([bc]*)c*/i
3037 ABC
3038
3039 /a([bc]*)(c*d)/i
3040 ABCD
3041
3042 /a([bc]+)(c*d)/i
3043 ABCD
3044
3045 /a([bc]*)(c+d)/i
3046 ABCD
3047
3048 /a[bcd]*dcdcde/i
3049 ADCDCDE
3050
3051 /a[bcd]+dcdcde/i
3052
3053 /(ab|a)b*c/i
3054 ABC
3055
3056 /((a)(b)c)(d)/i
3057 ABCD
3058
3059 /[a-zA-Z_][a-zA-Z0-9_]*/i
3060 ALPHA
3061
3062 /^a(bc+|b[eh])g|.h$/i
3063 ABH
3064
3065 /(bc+d$|ef*g.|h?i(j|k))/i
3066 EFFGZ
3067 IJ
3068 REFFGZ
3069 *** Failers
3070 ADCDCDE
3071 EFFG
3072 BCDD
3073
3074 /((((((((((a))))))))))/i
3075 A
3076
3077 /((((((((((a))))))))))\10/i
3078 AA
3079
3080 /(((((((((a)))))))))/i
3081 A
3082
3083 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i
3084 A
3085
3086 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i
3087 C
3088
3089 /multiple words of text/i
3090 *** Failers
3091 AA
3092 UH-UH
3093
3094 /multiple words/i
3095 MULTIPLE WORDS, YEAH
3096
3097 /(.*)c(.*)/i
3098 ABCDE
3099
3100 /\((.*), (.*)\)/i
3101 (A, B)
3102
3103 /[k]/i
3104
3105 /abcd/i
3106 ABCD
3107
3108 /a(bc)d/i
3109 ABCD
3110
3111 /a[-]?c/i
3112 AC
3113
3114 /(abc)\1/i
3115 ABCABC
3116
3117 /([a-c]*)\1/i
3118 ABCABC
3119
3120 /a(?!b)./
3121 abad
3122
3123 /a(?=d)./
3124 abad
3125
3126 /a(?=c|d)./
3127 abad
3128
3129 /a(?:b|c|d)(.)/
3130 ace
3131
3132 /a(?:b|c|d)*(.)/
3133 ace
3134
3135 /a(?:b|c|d)+?(.)/
3136 ace
3137 acdbcdbe
3138
3139 /a(?:b|c|d)+(.)/
3140 acdbcdbe
3141
3142 /a(?:b|c|d){2}(.)/
3143 acdbcdbe
3144
3145 /a(?:b|c|d){4,5}(.)/
3146 acdbcdbe
3147
3148 /a(?:b|c|d){4,5}?(.)/
3149 acdbcdbe
3150
3151 /((foo)|(bar))*/
3152 foobar
3153
3154 /a(?:b|c|d){6,7}(.)/
3155 acdbcdbe
3156
3157 /a(?:b|c|d){6,7}?(.)/
3158 acdbcdbe
3159
3160 /a(?:b|c|d){5,6}(.)/
3161 acdbcdbe
3162
3163 /a(?:b|c|d){5,6}?(.)/
3164 acdbcdbe
3165
3166 /a(?:b|c|d){5,7}(.)/
3167 acdbcdbe
3168
3169 /a(?:b|c|d){5,7}?(.)/
3170 acdbcdbe
3171
3172 /a(?:b|(c|e){1,2}?|d)+?(.)/
3173 ace
3174
3175 /^(.+)?B/
3176 AB
3177
3178 /^([^a-z])|(\^)$/
3179 .
3180
3181 /^[<>]&/
3182 <&OUT
3183
3184 /^(a\1?){4}$/
3185 aaaaaaaaaa
3186 *** Failers
3187 AB
3188 aaaaaaaaa
3189 aaaaaaaaaaa
3190
3191 /^(a(?(1)\1)){4}$/
3192 aaaaaaaaaa
3193 *** Failers
3194 aaaaaaaaa
3195 aaaaaaaaaaa
3196
3197 /(?:(f)(o)(o)|(b)(a)(r))*/
3198 foobar
3199
3200 /(?<=a)b/
3201 ab
3202 *** Failers
3203 cb
3204 b
3205
3206 /(?<!c)b/
3207 ab
3208 b
3209 b
3210
3211 /(?:..)*a/
3212 aba
3213
3214 /(?:..)*?a/
3215 aba
3216
3217 /^(?:b|a(?=(.)))*\1/
3218 abc
3219
3220 /^(){3,5}/
3221 abc
3222
3223 /^(a+)*ax/
3224 aax
3225
3226 /^((a|b)+)*ax/
3227 aax
3228
3229 /^((a|bc)+)*ax/
3230 aax
3231
3232 /(a|x)*ab/
3233 cab
3234
3235 /(a)*ab/
3236 cab
3237
3238 /(?:(?i)a)b/
3239 ab
3240
3241 /((?i)a)b/
3242 ab
3243
3244 /(?:(?i)a)b/
3245 Ab
3246
3247 /((?i)a)b/
3248 Ab
3249
3250 /(?:(?i)a)b/
3251 *** Failers
3252 cb
3253 aB
3254
3255 /((?i)a)b/
3256
3257 /(?i:a)b/
3258 ab
3259
3260 /((?i:a))b/
3261 ab
3262
3263 /(?i:a)b/
3264 Ab
3265
3266 /((?i:a))b/
3267 Ab
3268
3269 /(?i:a)b/
3270 *** Failers
3271 aB
3272 aB
3273
3274 /((?i:a))b/
3275
3276 /(?:(?-i)a)b/i
3277 ab
3278
3279 /((?-i)a)b/i
3280 ab
3281
3282 /(?:(?-i)a)b/i
3283 aB
3284
3285 /((?-i)a)b/i
3286 aB
3287
3288 /(?:(?-i)a)b/i
3289 *** Failers
3290 aB
3291 Ab
3292
3293 /((?-i)a)b/i
3294
3295 /(?:(?-i)a)b/i
3296 aB
3297
3298 /((?-i)a)b/i
3299 aB
3300
3301 /(?:(?-i)a)b/i
3302 *** Failers
3303 Ab
3304 AB
3305
3306 /((?-i)a)b/i
3307
3308 /(?-i:a)b/i
3309 ab
3310
3311 /((?-i:a))b/i
3312 ab
3313
3314 /(?-i:a)b/i
3315 aB
3316
3317 /((?-i:a))b/i
3318 aB
3319
3320 /(?-i:a)b/i
3321 *** Failers
3322 AB
3323 Ab
3324
3325 /((?-i:a))b/i
3326
3327 /(?-i:a)b/i
3328 aB
3329
3330 /((?-i:a))b/i
3331 aB
3332
3333 /(?-i:a)b/i
3334 *** Failers
3335 Ab
3336 AB
3337
3338 /((?-i:a))b/i
3339
3340 /((?-i:a.))b/i
3341 *** Failers
3342 AB
3343 a\nB
3344
3345 /((?s-i:a.))b/i
3346 a\nB
3347
3348 /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/
3349 cabbbb
3350
3351 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/
3352 caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
3353
3354 /(ab)\d\1/i
3355 Ab4ab
3356 ab4Ab
3357
3358 /foo\w*\d{4}baz/
3359 foobar1234baz
3360
3361 /x(~~)*(?:(?:F)?)?/
3362 x~~
3363
3364 /^a(?#xxx){3}c/
3365 aaac
3366
3367 /^a (?#xxx) (?#yyy) {3}c/x
3368 aaac
3369
3370 /(?<![cd])b/
3371 *** Failers
3372 B\nB
3373 dbcb
3374
3375 /(?<![cd])[ab]/
3376 dbaacb
3377
3378 /(?<!(c|d))b/
3379
3380 /(?<!(c|d))[ab]/
3381 dbaacb
3382
3383 /(?<!cd)[ab]/
3384 cdaccb
3385
3386 /^(?:a?b?)*$/
3387 \
3388 a
3389 ab
3390 aaa
3391 *** Failers
3392 dbcb
3393 a--
3394 aa--
3395
3396 /((?s)^a(.))((?m)^b$)/
3397 a\nb\nc\n
3398
3399 /((?m)^b$)/
3400 a\nb\nc\n
3401
3402 /(?m)^b/
3403 a\nb\n
3404
3405 /(?m)^(b)/
3406 a\nb\n
3407
3408 /((?m)^b)/
3409 a\nb\n
3410
3411 /\n((?m)^b)/
3412 a\nb\n
3413
3414 /((?s).)c(?!.)/
3415 a\nb\nc\n
3416 a\nb\nc\n
3417
3418 /((?s)b.)c(?!.)/
3419 a\nb\nc\n
3420 a\nb\nc\n
3421
3422 /^b/
3423
3424 /()^b/
3425 *** Failers
3426 a\nb\nc\n
3427 a\nb\nc\n
3428
3429 /((?m)^b)/
3430 a\nb\nc\n
3431
3432 /(x)?(?(1)a|b)/
3433 *** Failers
3434 a
3435 a
3436
3437 /(x)?(?(1)b|a)/
3438 a
3439
3440 /()?(?(1)b|a)/
3441 a
3442
3443 /()(?(1)b|a)/
3444
3445 /()?(?(1)a|b)/
3446 a
3447
3448 /^(\()?blah(?(1)(\)))$/
3449 (blah)
3450 blah
3451 *** Failers
3452 a
3453 blah)
3454 (blah
3455
3456 /^(\(+)?blah(?(1)(\)))$/
3457 (blah)
3458 blah
3459 *** Failers
3460 blah)
3461 (blah
3462
3463 /(?(?!a)a|b)/
3464
3465 /(?(?!a)b|a)/
3466 a
3467
3468 /(?(?=a)b|a)/
3469 *** Failers
3470 a
3471 a
3472
3473 /(?(?=a)a|b)/
3474 a
3475
3476 /(?=(a+?))(\1ab)/
3477 aaab
3478
3479 /^(?=(a+?))\1ab/
3480
3481 /(\w+:)+/
3482 one:
3483
3484 /$(?<=^(a))/
3485 a
3486
3487 /(?=(a+?))(\1ab)/
3488 aaab
3489
3490 /^(?=(a+?))\1ab/
3491 *** Failers
3492 aaab
3493 aaab
3494
3495 /([\w:]+::)?(\w+)$/
3496 abcd
3497 xy:z:::abcd
3498
3499 /^[^bcd]*(c+)/
3500 aexycd
3501
3502 /(a*)b+/
3503 caab
3504
3505 /([\w:]+::)?(\w+)$/
3506 abcd
3507 xy:z:::abcd
3508 *** Failers
3509 abcd:
3510 abcd:
3511
3512 /^[^bcd]*(c+)/
3513 aexycd
3514
3515 /(>a+)ab/
3516
3517 /(?>a+)b/
3518 aaab
3519
3520 /([[:]+)/
3521 a:[b]:
3522
3523 /([[=]+)/
3524 a=[b]=
3525
3526 /([[.]+)/
3527 a.[b].
3528
3529 /((?>a+)b)/
3530 aaab
3531
3532 /(?>(a+))b/
3533 aaab
3534
3535 /((?>[^()]+)|\([^()]*\))+/
3536 ((abc(ade)ufh()()x
3537
3538 /a\Z/
3539 *** Failers
3540 aaab
3541 a\nb\n
3542
3543 /b\Z/
3544 a\nb\n
3545
3546 /b\z/
3547
3548 /b\Z/
3549 a\nb
3550
3551 /b\z/
3552 a\nb
3553 *** Failers
3554
3555 /^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/
3556 a
3557 abc
3558 a-b
3559 0-9
3560 a.b
3561 5.6.7
3562 the.quick.brown.fox
3563 a100.b200.300c
3564 12-ab.1245
3565 *** Failers
3566 \
3567 .a
3568 -a
3569 a-
3570 a.
3571 a_b
3572 a.-
3573 a..
3574 ab..bc
3575 the.quick.brown.fox-
3576 the.quick.brown.fox.
3577 the.quick.brown.fox_
3578 the.quick.brown.fox+
3579
3580 /(?>.*)(?<=(abcd|wxyz))/
3581 alphabetabcd
3582 endingwxyz
3583 *** Failers
3584 a rather long string that doesn't end with one of them
3585
3586 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
3587 word cat dog elephant mussel cow horse canary baboon snake shark otherword
3588 word cat dog elephant mussel cow horse canary baboon snake shark
3589
3590 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
3591 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
3592
3593 /(?<=\d{3}(?!999))foo/
3594 999foo
3595 123999foo
3596 *** Failers
3597 123abcfoo
3598
3599 /(?<=(?!...999)\d{3})foo/
3600 999foo
3601 123999foo
3602 *** Failers
3603 123abcfoo
3604
3605 /(?<=\d{3}(?!999)...)foo/
3606 123abcfoo
3607 123456foo
3608 *** Failers
3609 123999foo
3610
3611 /(?<=\d{3}...)(?<!999)foo/
3612 123abcfoo
3613 123456foo
3614 *** Failers
3615 123999foo
3616
3617 /<a[\s]+href[\s]*=[\s]* # find <a href=
3618 ([\"\'])? # find single or double quote
3619 (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
3620 # quote, otherwise match up to next space
3621 /isx
3622 <a href=abcd xyz
3623 <a href=\"abcd xyz pqr\" cats
3624 <a href=\'abcd xyz pqr\' cats
3625
3626 /<a\s+href\s*=\s* # find <a href=
3627 (["'])? # find single or double quote
3628 (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching
3629 # quote, otherwise match up to next space
3630 /isx
3631 <a href=abcd xyz
3632 <a href=\"abcd xyz pqr\" cats
3633 <a href = \'abcd xyz pqr\' cats
3634
3635 /<a\s+href(?>\s*)=(?>\s*) # find <a href=
3636 (["'])? # find single or double quote
3637 (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching
3638 # quote, otherwise match up to next space
3639 /isx
3640 <a href=abcd xyz
3641 <a href=\"abcd xyz pqr\" cats
3642 <a href = \'abcd xyz pqr\' cats
3643
3644 /((Z)+|A)*/
3645 ZABCDEFG
3646
3647 /(Z()|A)*/
3648 ZABCDEFG
3649
3650 /(Z(())|A)*/
3651 ZABCDEFG
3652
3653 /((?>Z)+|A)*/
3654 ZABCDEFG
3655
3656 /((?>)+|A)*/
3657 ZABCDEFG
3658
3659 /a*/g
3660 abbab
3661
3662 /^[a-\d]/
3663 abcde
3664 -things
3665 0digit
3666 *** Failers
3667 bcdef
3668
3669 /^[\d-a]/
3670 abcde
3671 -things
3672 0digit
3673 *** Failers
3674 bcdef
3675
3676 /[[:space:]]+/
3677 > \x09\x0a\x0c\x0d\x0b<
3678
3679 /[[:blank:]]+/
3680 > \x09\x0a\x0c\x0d\x0b<
3681
3682 /[\s]+/
3683 > \x09\x0a\x0c\x0d\x0b<
3684
3685 /\s+/
3686 > \x09\x0a\x0c\x0d\x0b<
3687
3688 /a b/x
3689 ab
3690
3691 /(?!\A)x/m
3692 a\nxb\n
3693
3694 /(?!^)x/m
3695 a\nxb\n
3696
3697 /abc\Qabc\Eabc/
3698 abcabcabc
3699
3700 /abc\Q(*+|\Eabc/
3701 abc(*+|abc
3702
3703 / abc\Q abc\Eabc/x
3704 abc abcabc
3705 *** Failers
3706 abcabcabc
3707
3708 /abc#comment
3709 \Q#not comment
3710 literal\E/x
3711 abc#not comment\n literal
3712
3713 /abc#comment
3714 \Q#not comment
3715 literal/x
3716 abc#not comment\n literal
3717
3718 /abc#comment
3719 \Q#not comment
3720 literal\E #more comment
3721 /x
3722 abc#not comment\n literal
3723
3724 /abc#comment
3725 \Q#not comment
3726 literal\E #more comment/x
3727 abc#not comment\n literal
3728
3729 /\Qabc\$xyz\E/
3730 abc\\\$xyz
3731
3732 /\Qabc\E\$\Qxyz\E/
3733 abc\$xyz
3734
3735 /\Gabc/
3736 abc
3737 *** Failers
3738 xyzabc
3739
3740 /\Gabc./g
3741 abc1abc2xyzabc3
3742
3743 /abc./g
3744 abc1abc2xyzabc3
3745
3746 /a(?x: b c )d/
3747 XabcdY
3748 *** Failers
3749 Xa b c d Y
3750
3751 /((?x)x y z | a b c)/
3752 XabcY
3753 AxyzB
3754
3755 /(?i)AB(?-i)C/
3756 XabCY
3757 *** Failers
3758 XabcY
3759
3760 /((?i)AB(?-i)C|D)E/
3761 abCE
3762 DE
3763 *** Failers
3764 abcE
3765 abCe
3766 dE
3767 De
3768
3769 /(.*)\d+\1/
3770 abc123abc
3771 abc123bc
3772
3773 /(.*)\d+\1/s
3774 abc123abc
3775 abc123bc
3776
3777 /((.*))\d+\1/
3778 abc123abc
3779 abc123bc
3780
3781 /-- This tests for an IPv6 address in the form where it can have up to
3782 eight components, one and only one of which is empty. This must be
3783 an internal component. --/
3784
3785 /^(?!:) # colon disallowed at start
3786 (?: # start of item
3787 (?: [0-9a-f]{1,4} | # 1-4 hex digits or
3788 (?(1)0 | () ) ) # if null previously matched, fail; else null
3789 : # followed by colon
3790 ){1,7} # end item; 1-7 of them required
3791 [0-9a-f]{1,4} $ # final hex number at end of string
3792 (?(1)|.) # check that there was an empty component
3793 /xi
3794 a123::a123
3795 a123:b342::abcd
3796 a123:b342::324e:abcd
3797 a123:ddde:b342::324e:abcd
3798 a123:ddde:b342::324e:dcba:abcd
3799 a123:ddde:9999:b342::324e:dcba:abcd
3800 *** Failers
3801 1:2:3:4:5:6:7:8
3802 a123:bce:ddde:9999:b342::324e:dcba:abcd
3803 a123::9999:b342::324e:dcba:abcd
3804 abcde:2:3:4:5:6:7:8
3805 ::1
3806 abcd:fee0:123::
3807 :1
3808 1:
3809
3810 /[z\Qa-d]\E]/
3811 z
3812 a
3813 -
3814 d
3815 ]
3816 *** Failers
3817 b
3818
3819 /[\z\C]/
3820 z
3821 C
3822
3823 /\M/
3824 M
3825
3826 /(a+)*b/
3827 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3828
3829 /(?i)reg(?:ul(?:[a]|ae)r|ex)/
3830 REGular
3831 regulaer
3832 Regex
3833 regulr
3834
3835 /[--]+/
3836
3837
3838
3839
3840
3841 /(?<=Z)X./
3842 \x84XAZXB
3843
3844 /ab cd (?x) de fg/
3845 ab cd defg
3846
3847 /ab cd(?x) de fg/
3848 ab cddefg
3849 ** Failers
3850 abcddefg
3851
3852 /(?<![^f]oo)(bar)/
3853 foobarX
3854 ** Failers
3855 boobarX
3856
3857 /(?<![^f])X/
3858 offX
3859 ** Failers
3860 onyX
3861
3862 /(?<=[^f])X/
3863 onyX
3864 ** Failers
3865 offX
3866
3867 /^/mg
3868 a\nb\nc\n
3869 \
3870
3871 /(?<=C\n)^/mg
3872 A\nC\nC\n
3873
3874 /(?:(?(1)a|b)(X))+/
3875 bXaX
3876
3877 /(?:(?(1)\1a|b)(X|Y))+/
3878 bXXaYYaY
3879 bXYaXXaX
3880
3881 /()()()()()()()()()(?:(?(10)\10a|b)(X|Y))+/
3882 bXXaYYaY
3883
3884 /[[,abc,]+]/
3885 abc]
3886 a,b]
3887 [a,b,c]
3888
3889 /(?-x: )/x
3890 A\x20B
3891
3892 "(?x)(?-x: \s*#\s*)"
3893 A # B
3894 ** Failers
3895 #
3896
3897 "(?x-is)(?:(?-ixs) \s*#\s*) include"
3898 A #include
3899 ** Failers
3900 A#include
3901 A #Include
3902
3903 /a*b*\w/
3904 aaabbbb
3905 aaaa
3906 a
3907
3908 /a*b?\w/
3909 aaabbbb
3910 aaaa
3911 a
3912
3913 /a*b{0,4}\w/
3914 aaabbbb
3915 aaaa
3916 a
3917
3918 /a*b{0,}\w/
3919 aaabbbb
3920 aaaa
3921 a
3922
3923 /a*\d*\w/
3924 0a
3925 a
3926
3927 /a*b *\w/x
3928 a
3929
3930 /a*b#comment
3931 *\w/x
3932 a
3933
3934 /a* b *\w/x
3935 a
3936
3937 /^\w+=.*(\\\n.*)*/
3938 abc=xyz\\\npqr
3939
3940 /(?=(\w+))\1:/
3941 abcd:
3942
3943 /^(?=(\w+))\1:/
3944 abcd:
3945
3946 /^\Eabc/
3947 abc
3948
3949 /^[\Eabc]/
3950 a
3951 ** Failers
3952 E
3953
3954 /^[a-\Ec]/
3955 b
3956 ** Failers
3957 -
3958 E
3959
3960 /^[a\E\E-\Ec]/
3961 b
3962 ** Failers
3963 -
3964 E
3965
3966 /^[\E\Qa\E-\Qz\E]+/
3967 b
3968 ** Failers
3969 -
3970
3971 /^[a\Q]bc\E]/
3972 a
3973 ]
3974 c
3975
3976 /^[a-\Q\E]/
3977 a
3978 -
3979
3980 /^(a()*)*/
3981 aaaa
3982
3983 /^(?:a(?:(?:))*)*/
3984 aaaa
3985
3986 /^(a()+)+/
3987 aaaa
3988
3989 /^(?:a(?:(?:))+)+/
3990 aaaa
3991
3992 /(a){0,3}(?(1)b|(c|))*D/
3993 abbD
3994 ccccD
3995 D
3996
3997 /(a|)*\d/
3998 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3999 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
4000
4001 /(?>a|)*\d/
4002 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
4003 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
4004
4005 /(?:a|)*\d/
4006 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
4007 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
4008
4009 /\Z/g
4010 abc\n
4011
4012 /^(?s)(?>.*)(?<!\n)/
4013 abc
4014 abc\n
4015
4016 /^(?![^\n]*\n\z)/
4017 abc
4018 abc\n
4019
4020 /\z(?<!\n)/
4021 abc
4022 abc\n
4023
4024 /(.*(.)?)*/
4025 abcd
4026
4027 /( (A | (?(1)0|) )* )/x
4028 abcd
4029
4030 /( ( (?(1)0|) )* )/x
4031 abcd
4032
4033 /( (?(1)0|)* )/x
4034 abcd
4035
4036 /[[:abcd:xyz]]/
4037 a]
4038 :]
4039
4040 /[abc[:x\]pqr]/
4041 a
4042 [
4043 :
4044 ]
4045 p
4046
4047 /.*[op][xyz]/
4048 fooabcfoo
4049
4050 /(?(?=.*b)b|^)/
4051 adc
4052 abc
4053
4054 /(?(?=^.*b)b|^)/
4055 adc
4056 abc
4057
4058 /(?(?=.*b)b|^)*/
4059 adc
4060 abc
4061
4062 /(?(?=.*b)b|^)+/
4063 adc
4064 abc
4065
4066 /(?(?=b).*b|^d)/
4067 abc
4068
4069 /(?(?=.*b).*b|^d)/
4070 abc
4071
4072 /^%((?(?=[a])[^%])|b)*%$/
4073 %ab%
4074
4075 /(?i)a(?-i)b|c/
4076 XabX
4077 XAbX
4078 CcC
4079 ** Failers
4080 XABX
4081
4082 /[\x00-\xff\s]+/
4083 \x0a\x0b\x0c\x0d
4084
4085 /^\c/
4086 ?
4087
4088 /(abc)\1/i
4089 abc
4090
4091 /(abc)\1/
4092 abc
4093
4094 /[^a]*/i
4095 12abc
4096 12ABC
4097
4098 /[^a]*+/i
4099 12abc
4100 12ABC
4101
4102 /[^a]*?X/i
4103 ** Failers
4104 12abc
4105 12ABC
4106
4107 /[^a]+?X/i
4108 ** Failers
4109 12abc
4110 12ABC
4111
4112 /[^a]?X/i
4113 12aXbcX
4114 12AXBCX
4115 BCX
4116
4117 /[^a]??X/i
4118 12aXbcX
4119 12AXBCX
4120 BCX
4121
4122 /[^a]?+X/i
4123 12aXbcX
4124 12AXBCX
4125 BCX
4126
4127 /[^a]{2,3}/i
4128 abcdef
4129 ABCDEF
4130
4131 /[^a]{2,3}?/i
4132 abcdef
4133 ABCDEF
4134
4135 /[^a]{2,3}+/i
4136 abcdef
4137 ABCDEF
4138
4139 /((a|)+)+Z/
4140 Z
4141
4142 /(a)b|(a)c/
4143 ac
4144
4145 /(?>(a))b|(a)c/
4146 ac
4147
4148 /(?=(a))ab|(a)c/
4149 ac
4150
4151 /((?>(a))b|(a)c)/
4152 ac
4153
4154 /((?>(a))b|(a)c)++/
4155 ac
4156
4157 /(?:(?>(a))b|(a)c)++/
4158 ac
4159
4160 /(?=(?>(a))b|(a)c)(..)/
4161 ac
4162
4163 /(?>(?>(a))b|(a)c)/
4164 ac
4165
4166 /(?:(?>([ab])))+a=/+
4167 =ba=
4168
4169 /(?>([ab]))+a=/+
4170 =ba=
4171
4172 /((?>(a+)b)+(aabab))/
4173 aaaabaaabaabab
4174
4175 /(?>a+|ab)+?c/
4176 aabc
4177
4178 /(?>a+|ab)+c/
4179 aabc
4180
4181 /(?:a+|ab)+c/
4182 aabc
4183
4184 /(?(?=(a))a)/
4185 a
4186
4187 /(?(?=(a))a)(b)/
4188 ab
4189
4190 /^(?:a|ab)++c/
4191 aaaabc
4192
4193 /^(?>a|ab)++c/
4194 aaaabc
4195
4196 /^(?:a|ab)+c/
4197 aaaabc
4198
4199 /(?=abc){3}abc/+
4200 abcabcabc
4201 ** Failers
4202 xyz
4203
4204 /(?=abc)+abc/+
4205 abcabcabc
4206 ** Failers
4207 xyz
4208
4209 /(?=abc)++abc/+
4210 abcabcabc
4211 ** Failers
4212 xyz
4213
4214 /(?=abc){0}xyz/
4215 xyz
4216
4217 /(?=abc){1}xyz/
4218 ** Failers
4219 xyz
4220
4221 /(?=(a))?./
4222 ab
4223 bc
4224
4225 /(?=(a))??./
4226 ab
4227 bc
4228
4229 /^(?=(?1))?[az]([abc])d/
4230 abd
4231 zcdxx
4232
4233 /^(?!a){0}\w+/
4234 aaaaa
4235
4236 /(?<=(abc))?xyz/
4237 abcxyz
4238 pqrxyz
4239
4240 /^[\g<a>]+/
4241 ggg<<<aaa>>>
4242 ** Failers
4243 \\ga
4244
4245 /^[\ga]+/
4246 gggagagaxyz
4247
4248 /^[:a[:digit:]]+/
4249 aaaa444:::Z
4250
4251 /^[:a[:digit:]:b]+/
4252 aaaa444:::bbbZ
4253
4254 /[:a]xxx[b:]/
4255 :xxx:
4256
4257 /(?<=a{2})b/i
4258 xaabc
4259 ** Failers
4260 xabc
4261
4262 /(?<!a{2})b/i
4263 xabc
4264 ** Failers
4265 xaabc
4266
4267 /(?<=a\h)c/
4268 xa c
4269
4270 /(?<=[^a]{2})b/
4271 axxbc
4272 aAAbc
4273 ** Failers
4274 xaabc
4275
4276 /(?<=[^a]{2})b/i
4277 axxbc
4278 ** Failers
4279 aAAbc
4280 xaabc
4281
4282 /(?<=a\H)c/
4283 abc
4284
4285 /(?<=a\V)c/
4286 abc
4287
4288 /(?<=a\v)c/
4289 a\nc
4290
4291 /(?(?=c)c|d)++Y/
4292 XcccddYX
4293
4294 /(?(?=c)c|d)*+Y/
4295 XcccddYX
4296
4297 /^(a{2,3}){2,}+a/
4298 aaaaaaa
4299 ** Failers
4300 aaaaaa
4301 aaaaaaaaa
4302
4303 /^(a{2,3})++a/
4304 ** Failers
4305 aaaaaa
4306
4307 /^(a{2,3})*+a/
4308 ** Failers
4309 aaaaaa
4310
4311 /ab\Cde/
4312 abXde
4313
4314 /(?<=ab\Cde)X/
4315 abZdeX
4316
4317 /a[\CD]b/
4318 aCb
4319 aDb
4320
4321 /a[\C-X]b/
4322 aJb
4323
4324 /\H\h\V\v/
4325 X X\x0a
4326 X\x09X\x0b
4327 ** Failers
4328 \xa0 X\x0a
4329
4330 /\H*\h+\V?\v{3,4}/
4331 \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
4332 \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
4333 \x09\x20\xa0\x0a\x0b\x0c
4334 ** Failers
4335 \x09\x20\xa0\x0a\x0b
4336
4337 /\H{3,4}/
4338 XY ABCDE
4339 XY PQR ST
4340
4341 /.\h{3,4}./
4342 XY AB PQRS
4343
4344 /\h*X\h?\H+Y\H?Z/
4345 >XNNNYZ
4346 > X NYQZ
4347 ** Failers
4348 >XYZ
4349 > X NY Z
4350
4351 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
4352 >XY\x0aZ\x0aA\x0bNN\x0c
4353 >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
4354
4355 /(foo)\Kbar/
4356 foobar
4357
4358 /(foo)(\Kbar|baz)/
4359 foobar
4360 foobaz
4361
4362 /(foo\Kbar)baz/
4363 foobarbaz
4364
4365 /abc\K|def\K/g+
4366 Xabcdefghi
4367
4368 /ab\Kc|de\Kf/g+
4369 Xabcdefghi
4370
4371 /(?=C)/g+
4372 ABCDECBA
4373
4374 /^abc\K/+
4375 abcdef
4376 ** Failers
4377 defabcxyz
4378
4379 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
4380 ababababbbabZXXXX
4381
4382 /(?<A>tom|bon)-\g{A}/
4383 tom-tom
4384 bon-bon
4385
4386 /(^(a|b\g{-1}))/
4387 bacxxx
4388
4389 /(?|(abc)|(xyz))\1/
4390 abcabc
4391 xyzxyz
4392 ** Failers
4393 abcxyz
4394 xyzabc
4395
4396 /(?|(abc)|(xyz))(?1)/
4397 abcabc
4398 xyzabc
4399 ** Failers
4400 xyzxyz
4401
4402 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/
4403 XYabcdY
4404
4405 /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/
4406 XYabcdY
4407
4408 /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/
4409 XYabcdY
4410
4411 /(?'abc'\w+):\k<abc>{2}/
4412 a:aaxyz
4413 ab:ababxyz
4414 ** Failers
4415 a:axyz
4416 ab:abxyz
4417
4418 /(?'abc'\w+):\g{abc}{2}/
4419 a:aaxyz
4420 ab:ababxyz
4421 ** Failers
4422 a:axyz
4423 ab:abxyz
4424
4425 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x
4426 abd
4427 ce
4428
4429 /^(a.)\g-1Z/
4430 aXaXZ
4431
4432 /^(a.)\g{-1}Z/
4433 aXaXZ
4434
4435 /^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x
4436 abcd
4437
4438 /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
4439 (?(DEFINE)
4440 (?<NAME_PAT>[a-z]+)
4441 (?<ADDRESS_PAT>\d+)
4442 )/x
4443 metcalfe 33
4444
4445 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/
4446 1.2.3.4
4447 131.111.10.206
4448 10.0.0.0
4449 ** Failers
4450 10.6
4451 455.3.4.5
4452
4453 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/
4454 1.2.3.4
4455 131.111.10.206
4456 10.0.0.0
4457 ** Failers
4458 10.6
4459 455.3.4.5
4460
4461 /^(\w++|\s++)*$/
4462 now is the time for all good men to come to the aid of the party
4463 *** Failers
4464 this is not a line with only words and spaces!
4465
4466 /(\d++)(\w)/
4467 12345a
4468 *** Failers
4469 12345+
4470
4471 /a++b/
4472 aaab
4473
4474 /(a++b)/
4475 aaab
4476
4477 /(a++)b/
4478 aaab
4479
4480 /([^()]++|\([^()]*\))+/
4481 ((abc(ade)ufh()()x
4482
4483 /\(([^()]++|\([^()]+\))+\)/
4484 (abc)
4485 (abc(def)xyz)
4486 *** Failers
4487 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
4488
4489 /^([^()]|\((?1)*\))*$/
4490 abc
4491 a(b)c
4492 a(b(c))d
4493 *** Failers)
4494 a(b(c)d
4495
4496 /^>abc>([^()]|\((?1)*\))*<xyz<$/
4497 >abc>123<xyz<
4498 >abc>1(2)3<xyz<
4499 >abc>(1(2)3)<xyz<
4500
4501 /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
4502 1221
4503 Satanoscillatemymetallicsonatas
4504 AmanaplanacanalPanama
4505 AblewasIereIsawElba
4506 *** Failers
4507 Thequickbrownfox
4508
4509 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/
4510 12
4511 (((2+2)*-3)-7)
4512 -12
4513 *** Failers
4514 ((2+2)*-3)-7)
4515
4516 /^(x(y|(?1){2})z)/
4517 xyz
4518 xxyzxyzz
4519 *** Failers
4520 xxyzz
4521 xxyzxyzxyzz
4522
4523 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x
4524 <>
4525 <abcd>
4526 <abc <123> hij>
4527 <abc <def> hij>
4528 <abc<>def>
4529 <abc<>
4530 *** Failers
4531 <abc
4532
4533 /^a+(*FAIL)/
4534 aaaaaa
4535
4536 /a+b?c+(*FAIL)/
4537 aaabccc
4538
4539 /a+b?(*PRUNE)c+(*FAIL)/
4540 aaabccc
4541
4542 /a+b?(*COMMIT)c+(*FAIL)/
4543 aaabccc
4544
4545 /a+b?(*SKIP)c+(*FAIL)/
4546 aaabcccaaabccc
4547
4548 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
4549 aaaxxxxxx
4550 aaa++++++
4551 bbbxxxxx
4552 bbb+++++
4553 cccxxxx
4554 ccc++++
4555 dddddddd
4556
4557 /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
4558 aaaxxxxxx
4559 aaa++++++
4560 bbbxxxxx
4561 bbb+++++
4562 cccxxxx
4563 ccc++++
4564 dddddddd
4565
4566 /a+b?(*THEN)c+(*FAIL)/
4567 aaabccc
4568
4569 /(A (A|B(*ACCEPT)|C) D)(E)/x
4570 AB
4571 ABX
4572 AADE
4573 ACDE
4574 ** Failers
4575 AD
4576
4577 /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
4578 1221
4579 Satan, oscillate my metallic sonatas!
4580 A man, a plan, a canal: Panama!
4581 Able was I ere I saw Elba.
4582 *** Failers
4583 The quick brown fox
4584
4585 /^((.)(?1)\2|.)$/
4586 a
4587 aba
4588 aabaa
4589 abcdcba
4590 pqaabaaqp
4591 ablewasiereisawelba
4592 rhubarb
4593 the quick brown fox
4594
4595 /(a)(?<=b(?1))/
4596 baz
4597 ** Failers
4598 caz
4599
4600 /(?<=b(?1))(a)/
4601 zbaaz
4602 ** Failers
4603 aaa
4604
4605 /(?<X>a)(?<=b(?&X))/
4606 baz
4607
4608 /^(?|(abc)|(def))\1/
4609 abcabc
4610 defdef
4611 ** Failers
4612 abcdef
4613 defabc
4614
4615 /^(?|(abc)|(def))(?1)/
4616 abcabc
4617 defabc
4618 ** Failers
4619 defdef
4620 abcdef
4621
4622 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/xJ
4623 a\"aaaaa
4624 b\"aaaaa
4625 ** Failers
4626 b\"11111
4627
4628 /(?:(?1)|B)(A(*F)|C)/
4629 ABCD
4630 CCD
4631 ** Failers
4632 CAD
4633
4634 /^(?:(?1)|B)(A(*F)|C)/
4635 CCD
4636 BCD
4637 ** Failers
4638 ABCD
4639 CAD
4640 BAD
4641
4642 /(?:(?1)|B)(A(*ACCEPT)XX|C)D/
4643 AAD
4644 ACD
4645 BAD
4646 BCD
4647 BAX
4648 ** Failers
4649 ACX
4650 ABC
4651
4652 /(?(DEFINE)(A))B(?1)C/
4653 BAC
4654
4655 /(?(DEFINE)((A)\2))B(?1)C/
4656 BAAC
4657
4658 /(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x
4659 (ab(cd)ef)
4660
4661 /^(?=a(*SKIP)b|ac)/
4662 ** Failers
4663 ac
4664
4665 /^(?=a(*PRUNE)b)/
4666 ab
4667 ** Failers
4668 ac
4669
4670 /^(?=a(*ACCEPT)b)/
4671 ac
4672
4673 /(?>a\Kb)/
4674 ab
4675
4676 /((?>a\Kb))/
4677 ab
4678
4679 /(a\Kb)/
4680 ab
4681
4682 /^a\Kcz|ac/
4683 ac
4684
4685 /(?>a\Kbz|ab)/
4686 ab
4687
4688 /^(?&t)(?(DEFINE)(?<t>a\Kb))$/
4689 ab
4690
4691 /^([^()]|\((?1)*\))*$/
4692 a(b)c
4693 a(b(c)d)e
4694
4695 /(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/
4696 0
4697 00
4698 0000
4699
4700 /(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/
4701 0
4702 00
4703 0000
4704
4705 /--- This one does fail, as expected, in Perl. It needs the complex item at the
4706 end of the pattern. A single letter instead of (B|D) makes it not fail,
4707 which I think is a Perl bug. --- /
4708
4709 /A(*COMMIT)(B|D)/
4710 ACABX
4711
4712 /--- Check the use of names for failure ---/
4713
4714 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
4715 ** Failers
4716 AC
4717 CB
4718
4719 /--- Force no study, otherwise mark is not seen. The studied version is in
4720 test 2 because it isn't Perl-compatible. ---/
4721
4722 /(*MARK:A)(*SKIP:B)(C|X)/KSS
4723 C
4724 D
4725
4726 /^(A(*THEN:A)B|C(*THEN:B)D)/K
4727 ** Failers
4728 CB
4729
4730 /^(?:A(*THEN:A)B|C(*THEN:B)D)/K
4731 CB
4732
4733 /^(?>A(*THEN:A)B|C(*THEN:B)D)/K
4734 CB
4735
4736 /--- This should succeed, as the skip causes bump to offset 1 (the mark). Note
4737 that we have to have something complicated such as (B|Z) at the end because,
4738 for Perl, a simple character somehow causes an unwanted optimization to mess
4739 with the handling of backtracking verbs. ---/
4740
4741 /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK
4742 AAAC
4743
4744 /--- Test skipping over a non-matching mark. ---/
4745
4746 /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK
4747 AAAC
4748
4749 /--- Check shorthand for MARK ---/
4750
4751 /A(*:A)A+(*SKIP:A)(B|Z) | AC/xK
4752 AAAC
4753
4754 /--- Don't loop! Force no study, otherwise mark is not seen. ---/
4755
4756 /(*:A)A+(*SKIP:A)(B|Z)/KSS
4757 AAAC
4758
4759 /--- This should succeed, as a non-existent skip name disables the skip ---/
4760
4761 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
4762 AAAC
4763
4764 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
4765 AAAC
4766
4767 /--- COMMIT at the start of a pattern should act like an anchor. Again,
4768 however, we need the complication for Perl. ---/
4769
4770 /(*COMMIT)(A|P)(B|P)(C|P)/
4771 ABCDEFG
4772 ** Failers
4773 DEFGABC
4774
4775 /--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
4776
4777 /(\w+)(?>b(*COMMIT))\w{2}/
4778 abbb
4779
4780 /(\w+)b(*COMMIT)\w{2}/
4781 abbb
4782
4783 /--- Check opening parens in comment when seeking forward reference. ---/
4784
4785 /(?&t)(?#()(?(DEFINE)(?<t>a))/
4786 bac
4787
4788 /--- COMMIT should override THEN ---/
4789
4790 /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
4791 yes
4792
4793 /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
4794 yes
4795
4796 /b?(*SKIP)c/
4797 bc
4798 abc
4799
4800 /(*SKIP)bc/
4801 a
4802
4803 /(*SKIP)b/
4804 a
4805
4806 /(?P<abn>(?P=abn)xxx|)+/
4807 xxx
4808
4809 /(?i:([^b]))(?1)/
4810 aa
4811 aA
4812 ** Failers
4813 ab
4814 aB
4815 Ba
4816 ba
4817
4818 /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
4819 aaaaaaX
4820 ** Failers
4821 aaaaaa
4822
4823 /^(?&t)*(?(DEFINE)(?<t>a))\w$/
4824 aaaaaaX
4825 aaaaaa
4826
4827 /^(a)*+(\w)/
4828 aaaaX
4829 YZ
4830 ** Failers
4831 aaaa
4832
4833 /^(?:a)*+(\w)/
4834 aaaaX
4835 YZ
4836 ** Failers
4837 aaaa
4838
4839 /^(a)++(\w)/
4840 aaaaX
4841 ** Failers
4842 aaaa
4843 YZ
4844
4845 /^(?:a)++(\w)/
4846 aaaaX
4847 ** Failers
4848 aaaa
4849 YZ
4850
4851 /^(a)?+(\w)/
4852 aaaaX
4853 YZ
4854
4855 /^(?:a)?+(\w)/
4856 aaaaX
4857 YZ
4858
4859 /^(a){2,}+(\w)/
4860 aaaaX
4861 ** Failers
4862 aaa
4863 YZ
4864
4865 /^(?:a){2,}+(\w)/
4866 aaaaX
4867 ** Failers
4868 aaa
4869 YZ
4870
4871 /(a|)*(?1)b/
4872 b
4873 ab
4874 aab
4875
4876 /(a)++(?1)b/
4877 ** Failers
4878 ab
4879 aab
4880
4881 /(a)*+(?1)b/
4882 ** Failers
4883 ab
4884 aab
4885
4886 /(?1)(?:(b)){0}/
4887 b
4888
4889 /(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x
4890 foo(bar(baz)+baz(bop))
4891
4892 /(A (A|B(*ACCEPT)|C) D)(E)/x
4893 AB
4894
4895 /\A.*?(a|bc)/
4896 ba
4897
4898 /\A.*?(?:a|bc)++/
4899 ba
4900
4901 /\A.*?(a|bc)++/
4902 ba
4903
4904 /\A.*?(?:a|bc|d)/
4905 ba
4906
4907 /(?:(b))++/
4908 beetle
4909
4910 /(?(?=(a(*ACCEPT)z))a)/
4911 a
4912
4913 /^(a)(?1)+ab/
4914 aaaab
4915
4916 /^(a)(?1)++ab/
4917 aaaab
4918
4919 /^(?=a(*:M))aZ/K
4920 aZbc
4921
4922 /^(?!(*:M)b)aZ/K
4923 aZbc
4924
4925 /(?(DEFINE)(a))?b(?1)/
4926 backgammon
4927
4928 /^\N+/
4929 abc\ndef
4930
4931 /^\N{1,}/
4932 abc\ndef
4933
4934 /(?(R)a+|(?R)b)/
4935 aaaabcde
4936
4937 /(?(R)a+|((?R))b)/
4938 aaaabcde
4939
4940 /((?(R)a+|(?1)b))/
4941 aaaabcde
4942
4943 /((?(R1)a+|(?1)b))/
4944 aaaabcde
4945
4946 /a(*:any
4947 name)/K
4948 abc
4949
4950 /(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/
4951 a
4952 ba
4953 bba
4954
4955 /--- Checking revised (*THEN) handling ---/
4956
4957 /--- Capture ---/
4958
4959 /^.*? (a(*THEN)b) c/x
4960 aabc
4961
4962 /^.*? (a(*THEN)b|(*F)) c/x
4963 aabc
4964
4965 /^.*? ( (a(*THEN)b) | (*F) ) c/x
4966 aabc
4967
4968 /^.*? ( (a(*THEN)b) ) c/x
4969 aabc
4970
4971 /--- Non-capture ---/
4972
4973 /^.*? (?:a(*THEN)b) c/x
4974 aabc
4975
4976 /^.*? (?:a(*THEN)b|(*F)) c/x
4977 aabc
4978
4979 /^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
4980 aabc
4981
4982 /^.*? (?: (?:a(*THEN)b) ) c/x
4983 aabc
4984
4985 /--- Atomic ---/
4986
4987 /^.*? (?>a(*THEN)b) c/x
4988 aabc
4989
4990 /^.*? (?>a(*THEN)b|(*F)) c/x
4991 aabc
4992
4993 /^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
4994 aabc
4995
4996 /^.*? (?> (?>a(*THEN)b) ) c/x
4997 aabc
4998
4999 /--- Possessive capture ---/
5000
5001 /^.*? (a(*THEN)b)++ c/x
5002 aabc
5003
5004 /^.*? (a(*THEN)b|(*F))++ c/x
5005 aabc
5006
5007 /^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
5008 aabc
5009
5010 /^.*? ( (a(*THEN)b)++ )++ c/x
5011 aabc
5012
5013 /--- Possessive non-capture ---/
5014
5015 /^.*? (?:a(*THEN)b)++ c/x
5016 aabc
5017
5018 /^.*? (?:a(*THEN)b|(*F))++ c/x
5019 aabc
5020
5021 /^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
5022 aabc
5023
5024 /^.*? (?: (?:a(*THEN)b)++ )++ c/x
5025 aabc
5026
5027 /--- Condition assertion ---/
5028
5029 /^(?(?=a(*THEN)b)ab|ac)/
5030 ac
5031
5032 /--- Condition ---/
5033
5034 /^.*?(?(?=a)a|b(*THEN)c)/
5035 ba
5036
5037 /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
5038 ba
5039
5040 /^.*?(?(?=a)a(*THEN)b|c)/
5041 ac
5042
5043 /--- Assertion ---/
5044
5045 /^.*(?=a(*THEN)b)/
5046 aabc
5047
5048 /------------------------------/
5049
5050 /(?>a(*:m))/imsxSK
5051 a
5052
5053 /(?>(a)(*:m))/imsxSK
5054 a
5055
5056 /(?<=a(*ACCEPT)b)c/
5057 xacd
5058
5059 /(?<=(a(*ACCEPT)b))c/
5060 xacd
5061
5062 /(?<=(a(*COMMIT)b))c/
5063 xabcd
5064 ** Failers
5065 xacd
5066
5067 /(?<!a(*FAIL)b)c/
5068 xcd
5069 acd
5070
5071 /(?<=a(*:N)b)c/K
5072 xabcd
5073
5074 /(?<=a(*PRUNE)b)c/
5075 xabcd
5076
5077 /(?<=a(*SKIP)b)c/
5078 xabcd
5079
5080 /(?<=a(*THEN)b)c/
5081 xabcd
5082
5083 /(a)(?2){2}(.)/
5084 abcd
5085
5086 /(*MARK:A)(*PRUNE:B)(C|X)/KS
5087 C
5088 D
5089
5090 /(*MARK:A)(*PRUNE:B)(C|X)/KSS
5091 C
5092 D
5093
5094 /(*MARK:A)(*THEN:B)(C|X)/KS
5095 C
5096 D
5097
5098 /(*MARK:A)(*THEN:B)(C|X)/KSY
5099 C
5100 D
5101
5102 /(*MARK:A)(*THEN:B)(C|X)/KSS
5103 C
5104 D
5105
5106 /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
5107
5108 /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
5109 AAAC
5110
5111 /--- Same --/
5112
5113 /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
5114 AAAC
5115
5116 /A(*:A)A+(*SKIP)(B|Z) | AC/xK
5117 AAAC
5118
5119 /--- This should fail, as a null name is the same as no name ---/
5120
5121 /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
5122 AAAC
5123
5124 /--- A check on what happens after hitting a mark and them bumping along to
5125 something that does not even start. Perl reports tags after the failures here,
5126 though it does not when the individual letters are made into something
5127 more complicated. ---/
5128
5129 /A(*:A)B|XX(*:B)Y/K
5130 AABC
5131 XXYZ
5132 ** Failers
5133 XAQQ
5134 XAQQXZZ
5135 AXQQQ
5136 AXXQQQ
5137
5138 /^(A(*THEN:A)B|C(*THEN:B)D)/K
5139 AB
5140 CD
5141 ** Failers
5142 AC
5143 CB
5144
5145 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
5146 AB
5147 CD
5148 ** Failers
5149 AC
5150 CB
5151
5152 /--- An empty name does not pass back an empty string. It is the same as if no
5153 name were given. ---/
5154
5155 /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
5156 AB
5157 CD
5158
5159 /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
5160
5161 /A(*PRUNE:A)B/K
5162 ACAB
5163
5164 /--- Mark names can be duplicated ---/
5165
5166 /A(*:A)B|X(*:A)Y/K
5167 AABC
5168 XXYZ
5169
5170 /b(*:m)f|a(*:n)w/K
5171 aw
5172 ** Failers
5173 abc
5174
5175 /b(*:m)f|aw/K
5176 abaw
5177 ** Failers
5178 abc
5179 abax
5180
5181 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
5182 AAAC
5183
5184 /a(*PRUNE:X)bc|qq/KY
5185 ** Failers
5186 axy
5187
5188 /a(*THEN:X)bc|qq/KY
5189 ** Failers
5190 axy
5191
5192 /(?=a(*MARK:A)b)..x/K
5193 abxy
5194 ** Failers
5195 abpq
5196
5197 /(?=a(*MARK:A)b)..(*:Y)x/K
5198 abxy
5199 ** Failers
5200 abpq
5201
5202 /(?=a(*PRUNE:A)b)..x/K
5203 abxy
5204 ** Failers
5205 abpq
5206
5207 /(?=a(*PRUNE:A)b)..(*:Y)x/K
5208 abxy
5209 ** Failers
5210 abpq
5211
5212 /(?=a(*THEN:A)b)..x/K
5213 abxy
5214 ** Failers
5215 abpq
5216
5217 /(?=a(*THEN:A)b)..(*:Y)x/K
5218 abxy
5219 ** Failers
5220 abpq
5221
5222 /(another)?(\1?)test/
5223 hello world test
5224
5225 /(another)?(\1+)test/
5226 hello world test
5227
5228 /(a(*COMMIT)b){0}a(?1)|aac/
5229 aac
5230
5231 /((?:a?)*)*c/
5232 aac
5233
5234 /((?>a?)*)*c/
5235 aac
5236
5237 /(?>.*?a)(?<=ba)/
5238 aba
5239
5240 /(?:.*?a)(?<=ba)/
5241 aba
5242
5243 /.*?a(*PRUNE)b/
5244 aab
5245
5246 /.*?a(*PRUNE)b/s
5247 aab
5248
5249 /^a(*PRUNE)b/s
5250 aab
5251
5252 /.*?a(*SKIP)b/
5253 aab
5254
5255 /(?>.*?a)b/s
5256 aab
5257
5258 /(?>.*?a)b/
5259 aab
5260
5261 /(?>^a)b/s
5262 aab
5263
5264 /(?>.*?)(?<=(abcd)|(wxyz))/
5265 alphabetabcd
5266 endingwxyz
5267
5268 /(?>.*)(?<=(abcd)|(wxyz))/
5269 alphabetabcd
5270 endingwxyz
5271
5272 "(?>.*)foo"
5273 abcdfooxyz
5274
5275 "(?>.*?)foo"
5276 abcdfooxyz
5277
5278 /(?:(a(*PRUNE)b)){0}(?:(?1)|ac)/
5279 ac
5280
5281 /(?:(a(*SKIP)b)){0}(?:(?1)|ac)/
5282 ac
5283
5284 /(?<=(*SKIP)ac)a/
5285 aa
5286
5287 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
5288 AAAC
5289
5290 /a(*SKIP:m)x|ac(*:n)(*SKIP:n)d|ac/K
5291 acacd
5292
5293 /A(*SKIP:m)x|A(*SKIP:n)x|AB/K
5294 AB
5295
5296 /((*SKIP:r)d){0}a(*SKIP:m)x|ac(*:n)|ac/K
5297 acacd
5298
5299 /-- Tests that try to figure out how Perl works. My hypothesis is that the
5300 first verb that is backtracked onto is the one that acts. This seems to be
5301 the case almost all the time, but there is one exception that is perhaps a
5302 bug. --/
5303
5304 /-- This matches "aaaac"; each PRUNE advances one character until the subject
5305 no longer starts with 5 'a's. --/
5306
5307 /aaaaa(*PRUNE)b|a+c/
5308 aaaaaac
5309
5310 /-- Putting SKIP in front of PRUNE makes no difference, as it is never
5311 backtracked onto, whether or not it has a label. --/
5312
5313 /aaaaa(*SKIP)(*PRUNE)b|a+c/
5314 aaaaaac
5315
5316 /aaaaa(*SKIP:N)(*PRUNE)b|a+c/
5317 aaaaaac
5318
5319 /aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c/
5320 aaaaaac
5321
5322 /-- Putting THEN in front makes no difference. */
5323
5324 /aaaaa(*THEN)(*PRUNE)b|a+c/
5325 aaaaaac
5326
5327 /-- However, putting COMMIT in front of the prune changes it to "no match". I
5328 think this is inconsistent and possibly a bug. For the moment, running this
5329 test is moved out of the Perl-compatible file. --/
5330
5331 /aaaaa(*COMMIT)(*PRUNE)b|a+c/
5332
5333
5334 /---- OK, lets play the same game again using SKIP instead of PRUNE. ----/
5335
5336 /-- This matches "ac" because SKIP forces the next match to start on the
5337 sixth "a". --/
5338
5339 /aaaaa(*SKIP)b|a+c/
5340 aaaaaac
5341
5342 /-- Putting PRUNE in front makes no difference. --/
5343
5344 /aaaaa(*PRUNE)(*SKIP)b|a+c/
5345 aaaaaac
5346
5347 /-- Putting THEN in front makes no difference. --/
5348
5349 /aaaaa(*THEN)(*SKIP)b|a+c/
5350 aaaaaac
5351
5352 /-- In this case, neither does COMMIT. This still matches "ac". --/
5353
5354 /aaaaa(*COMMIT)(*SKIP)b|a+c/
5355 aaaaaac
5356
5357 /-- This gives "no match", as expected. --/
5358
5359 /aaaaa(*COMMIT)b|a+c/
5360 aaaaaac
5361
5362
5363 /------ Tests using THEN ------/
5364
5365 /-- This matches "aaaaaac", as expected. --/
5366
5367 /aaaaa(*THEN)b|a+c/
5368 aaaaaac
5369
5370 /-- Putting SKIP in front makes no difference. --/
5371
5372 /aaaaa(*SKIP)(*THEN)b|a+c/
5373 aaaaaac
5374
5375 /-- Putting PRUNE in front makes no difference. --/
5376
5377 /aaaaa(*PRUNE)(*THEN)b|a+c/
5378 aaaaaac
5379
5380 /-- Putting COMMIT in front makes no difference. --/
5381
5382 /aaaaa(*COMMIT)(*THEN)b|a+c/
5383 aaaaaac
5384
5385 /-- End of "priority" tests --/
5386
5387 /aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+/
5388 aaaaaa
5389
5390 /aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
5391 aaaaaa
5392
5393 /aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+/
5394 aaaaaa
5395
5396 /aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
5397 aaaaaa
5398
5399 /a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c/
5400 aaaac
5401
5402 /a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c/
5403 aaaac
5404
5405 /aaa(*PRUNE:A)a(*SKIP:A)b|a+c/
5406 aaaac
5407
5408 /aaa(*MARK:A)a(*SKIP:A)b|a+c/
5409 aaaac
5410
5411 /a(*:m)a(*COMMIT)(*SKIP:m)b|a+c/K
5412 aaaaaac
5413
5414 /.?(a|b(*THEN)c)/
5415 ba
5416
5417 /(a(*COMMIT)b)c|abd/
5418 abc
5419 abd
5420
5421 /(?=a(*COMMIT)b)abc|abd/
5422 abc
5423 abd
5424
5425 /(?>a(*COMMIT)b)c|abd/
5426 abc
5427 abd
5428
5429 /a(?=b(*COMMIT)c)[^d]|abd/
5430 abd
5431 abc
5432
5433 /a(?=bc).|abd/
5434 abd
5435 abc
5436
5437 /a(?>b(*COMMIT)c)d|abd/
5438 abceabd
5439
5440 /a(?>bc)d|abd/
5441 abceabd
5442
5443 /(?>a(*COMMIT)b)c|abd/
5444 abd
5445
5446 /(?>a(*COMMIT)c)d|abd/
5447 abd
5448
5449 /((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
5450 ac
5451
5452 /-- These tests were formerly in test 2, but changes in PCRE and Perl have
5453 made them compatible. --/
5454
5455 /^(a)?(?(1)a|b)+$/
5456 *** Failers
5457 a
5458
5459 /(?=a\Kb)ab/
5460 ab
5461
5462 /(?!a\Kb)ac/
5463 ac
5464
5465 /^abc(?<=b\Kc)d/
5466 abcd
5467
5468 /^abc(?<!b\Kq)d/
5469 abcd
5470
5471
5472 /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
5473 AAAC
5474
5475 /^((abc|abcx)(*THEN)y|abcd)/
5476 abcd
5477 *** Failers
5478 abcxy
5479
5480 /^((yes|no)(*THEN)(*F))?/
5481 yes
5482
5483 /(A (.*) C? (*THEN) | A D) (*FAIL)/x
5484 AbcdCBefgBhiBqz
5485
5486 /(A (.*) C? (*THEN) | A D) z/x
5487 AbcdCBefgBhiBqz
5488
5489 /(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x
5490 AbcdCBefgBhiBqz
5491
5492 /(A (.*) C? (*THEN) | A D) \s* z/x
5493 AbcdCBefgBhiBqz
5494
5495 /(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x
5496 AbcdCBefgBhiBqz
5497
5498 /(A (.*) (?:C|) (*THEN) | A D) z/x
5499 AbcdCBefgBhiBqz
5500
5501 /(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x
5502 AbcdCBefgBhiBqz
5503
5504 /(A (.*) C{0,6} (*THEN) | A D) z/x
5505 AbcdCBefgBhiBqz
5506
5507 /(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x
5508 AbcdCEBefgBhiBqz
5509
5510 /(A (.*) (CE){0,6} (*THEN) | A D) z/x
5511 AbcdCEBefgBhiBqz
5512
5513 /(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x
5514 AbcdCBefgBhiBqz
5515
5516 /(A (.*) (CE*){0,6} (*THEN) | A D) z/x
5517 AbcdCBefgBhiBqz
5518
5519 /(?=a(*COMMIT)b|ac)ac|ac/
5520 ac
5521
5522 /(?=a(*COMMIT)b|(ac)) ac | (a)c/x
5523 ac
5524
5525 /--------/
5526
5527 /(?(?!b(*THEN)a)bn|bnn)/
5528 bnn
5529
5530 /(?!b(*SKIP)a)bn|bnn/
5531 bnn
5532
5533 /(?(?!b(*SKIP)a)bn|bnn)/
5534 bnn
5535
5536 /(?!b(*PRUNE)a)bn|bnn/
5537 bnn
5538
5539 /(?(?!b(*PRUNE)a)bn|bnn)/
5540 bnn
5541
5542 /(?!b(*COMMIT)a)bn|bnn/
5543 bnn
5544
5545 /(?(?!b(*COMMIT)a)bn|bnn)/
5546 bnn
5547
5548 /(?=b(*SKIP)a)bn|bnn/
5549 bnn
5550
5551 /(?=b(*THEN)a)bn|bnn/
5552 bnn
5553
5554 /^(?!a(*SKIP)b)/
5555 ac
5556
5557 /^(?!a(*SKIP)b)../
5558 acd
5559
5560 /(?!a(*SKIP)b)../
5561 acd
5562
5563 /^(?(?!a(*SKIP)b))/
5564 ac
5565
5566 /^(?!a(*PRUNE)b)../
5567 acd
5568
5569 /(?!a(*PRUNE)b)../
5570 acd
5571
5572 /(?!a(*COMMIT)b)ac|cd/
5573 ac
5574
5575 /\A.*?(?:a|bc)/
5576 ba
5577
5578 /^(A(*THEN)B|C(*THEN)D)/
5579 CD
5580
5581 /(*:m(m)(?&y)(?(DEFINE)(?<y>b))/K
5582 abc
5583
5584 /(*PRUNE:m(m)(?&y)(?(DEFINE)(?<y>b))/K
5585 abc
5586
5587 /(*SKIP:m(m)(?&y)(?(DEFINE)(?<y>b))/K
5588 abc
5589
5590 /(*THEN:m(m)(?&y)(?(DEFINE)(?<y>b))/K
5591 abc
5592
5593 /^\d*\w{4}/
5594 1234
5595 123
5596
5597 /^[^b]*\w{4}/
5598 aaaa
5599 aaa
5600
5601 /^[^b]*\w{4}/i
5602 aaaa
5603 aaa
5604
5605 /^a*\w{4}/
5606 aaaa
5607 aaa
5608
5609 /^a*\w{4}/i
5610 aaaa
5611 aaa
5612
5613 /(?(?=ab)ab)/+
5614 ca
5615 cd
5616
5617 /(?:(?<n>foo)|(?<n>bar))\k<n>/J
5618 foofoo
5619 barbar
5620
5621 /(?<n>A)(?:(?<n>foo)|(?<n>bar))\k<n>/J
5622 AfooA
5623 AbarA
5624 ** Failers
5625 Afoofoo
5626 Abarbar
5627
5628 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
5629 1 IN SOA non-sp1 non-sp2(
5630
5631 /^ (?:(?<A>A)|(?'B'B)(?<A>A)) (?('A')x) (?(<B>)y)$/xJ
5632 Ax
5633 BAxy
5634
5635 /^A\xZ/
5636 A\0Z
5637
5638 /^A\o{123}B/
5639 A\123B
5640
5641 /-- End of testinput1 --/

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5