~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to srclib/pcre/testdata/testinput1

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

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