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

Contents of /code/trunk/testdata/testinput1

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5