forked from dlclark/regexp2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testoutput1
7059 lines (6226 loc) · 106 KB
/
testoutput1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This set of tests is for features that are compatible with all versions of
# Perl >= 5.10, in non-UTF mode. It should run clean for the 8-bit, 16-bit, and
# 32-bit PCRE libraries, and also using the perltest.pl script.
#forbid_utf
#newline_default lf any anycrlf
#perltest
/the quick brown fox/
the quick brown fox
0: the quick brown fox
What do you know about the quick brown fox?
0: the quick brown fox
\= Expect no match
The quick brown FOX
No match
What do you know about THE QUICK BROWN FOX?
No match
/The quick brown fox/i
the quick brown fox
0: the quick brown fox
The quick brown FOX
0: The quick brown FOX
What do you know about the quick brown fox?
0: the quick brown fox
What do you know about THE QUICK BROWN FOX?
0: THE QUICK BROWN FOX
/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
abcd\t\n\r\f\a\e9;\$\\?caxyz
0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz
/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
abxyzpqrrrabbxyyyypqAzz
0: abxyzpqrrrabbxyyyypqAzz
abxyzpqrrrabbxyyyypqAzz
0: abxyzpqrrrabbxyyyypqAzz
aabxyzpqrrrabbxyyyypqAzz
0: aabxyzpqrrrabbxyyyypqAzz
aaabxyzpqrrrabbxyyyypqAzz
0: aaabxyzpqrrrabbxyyyypqAzz
aaaabxyzpqrrrabbxyyyypqAzz
0: aaaabxyzpqrrrabbxyyyypqAzz
abcxyzpqrrrabbxyyyypqAzz
0: abcxyzpqrrrabbxyyyypqAzz
aabcxyzpqrrrabbxyyyypqAzz
0: aabcxyzpqrrrabbxyyyypqAzz
aaabcxyzpqrrrabbxyyyypAzz
0: aaabcxyzpqrrrabbxyyyypAzz
aaabcxyzpqrrrabbxyyyypqAzz
0: aaabcxyzpqrrrabbxyyyypqAzz
aaabcxyzpqrrrabbxyyyypqqAzz
0: aaabcxyzpqrrrabbxyyyypqqAzz
aaabcxyzpqrrrabbxyyyypqqqAzz
0: aaabcxyzpqrrrabbxyyyypqqqAzz
aaabcxyzpqrrrabbxyyyypqqqqAzz
0: aaabcxyzpqrrrabbxyyyypqqqqAzz
aaabcxyzpqrrrabbxyyyypqqqqqAzz
0: aaabcxyzpqrrrabbxyyyypqqqqqAzz
aaabcxyzpqrrrabbxyyyypqqqqqqAzz
0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz
aaaabcxyzpqrrrabbxyyyypqAzz
0: aaaabcxyzpqrrrabbxyyyypqAzz
abxyzzpqrrrabbxyyyypqAzz
0: abxyzzpqrrrabbxyyyypqAzz
aabxyzzzpqrrrabbxyyyypqAzz
0: aabxyzzzpqrrrabbxyyyypqAzz
aaabxyzzzzpqrrrabbxyyyypqAzz
0: aaabxyzzzzpqrrrabbxyyyypqAzz
aaaabxyzzzzpqrrrabbxyyyypqAzz
0: aaaabxyzzzzpqrrrabbxyyyypqAzz
abcxyzzpqrrrabbxyyyypqAzz
0: abcxyzzpqrrrabbxyyyypqAzz
aabcxyzzzpqrrrabbxyyyypqAzz
0: aabcxyzzzpqrrrabbxyyyypqAzz
aaabcxyzzzzpqrrrabbxyyyypqAzz
0: aaabcxyzzzzpqrrrabbxyyyypqAzz
aaaabcxyzzzzpqrrrabbxyyyypqAzz
0: aaaabcxyzzzzpqrrrabbxyyyypqAzz
aaaabcxyzzzzpqrrrabbbxyyyypqAzz
0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz
aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
aaabcxyzpqrrrabbxyyyypABzz
0: aaabcxyzpqrrrabbxyyyypABzz
aaabcxyzpqrrrabbxyyyypABBzz
0: aaabcxyzpqrrrabbxyyyypABBzz
>>>aaabxyzpqrrrabbxyyyypqAzz
0: aaabxyzpqrrrabbxyyyypqAzz
>aaaabxyzpqrrrabbxyyyypqAzz
0: aaaabxyzpqrrrabbxyyyypqAzz
>>>>abcxyzpqrrrabbxyyyypqAzz
0: abcxyzpqrrrabbxyyyypqAzz
\= Expect no match
abxyzpqrrabbxyyyypqAzz
No match
abxyzpqrrrrabbxyyyypqAzz
No match
abxyzpqrrrabxyyyypqAzz
No match
aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
No match
aaaabcxyzzzzpqrrrabbbxyyypqAzz
No match
aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
No match
/^(abc){1,2}zz/
abczz
0: abczz
1: abc
abcabczz
0: abcabczz
1: abc
\= Expect no match
zz
No match
abcabcabczz
No match
>>abczz
No match
/^(b+?|a){1,2}?c/
bc
0: bc
1: b
bbc
0: bbc
1: b
bbbc
0: bbbc
1: bb
bac
0: bac
1: a
bbac
0: bbac
1: a
aac
0: aac
1: a
abbbbbbbbbbbc
0: abbbbbbbbbbbc
1: bbbbbbbbbbb
bbbbbbbbbbbac
0: bbbbbbbbbbbac
1: a
\= Expect no match
aaac
No match
abbbbbbbbbbbac
No match
/^(b+|a){1,2}c/
bc
0: bc
1: b
bbc
0: bbc
1: bb
bbbc
0: bbbc
1: bbb
bac
0: bac
1: a
bbac
0: bbac
1: a
aac
0: aac
1: a
abbbbbbbbbbbc
0: abbbbbbbbbbbc
1: bbbbbbbbbbb
bbbbbbbbbbbac
0: bbbbbbbbbbbac
1: a
\= Expect no match
aaac
No match
abbbbbbbbbbbac
No match
/^(b+|a){1,2}?bc/
bbc
0: bbc
1: b
/^(b*|ba){1,2}?bc/
babc
0: babc
1: ba
bbabc
0: bbabc
1: ba
bababc
0: bababc
1: ba
\= Expect no match
bababbc
No match
babababc
No match
/^(ba|b*){1,2}?bc/
babc
0: babc
1: ba
bbabc
0: bbabc
1: ba
bababc
0: bababc
1: ba
\= Expect no match
bababbc
No match
babababc
No match
#/^\ca\cA\c[;\c:/
# \x01\x01\e;z
# 0: \x01\x01\x1b;z
/^[ab\]cde]/
athing
0: a
bthing
0: b
]thing
0: ]
cthing
0: c
dthing
0: d
ething
0: e
\= Expect no match
fthing
No match
[thing
No match
\\thing
No match
/^[]cde]/
]thing
0: ]
cthing
0: c
dthing
0: d
ething
0: e
\= Expect no match
athing
No match
fthing
No match
/^[^ab\]cde]/
fthing
0: f
[thing
0: [
\\thing
0: \
\= Expect no match
athing
No match
bthing
No match
]thing
No match
cthing
No match
dthing
No match
ething
No match
/^[^]cde]/
athing
0: a
fthing
0: f
\= Expect no match
]thing
No match
cthing
No match
dthing
No match
ething
No match
# DLC - I don't get this one
#/^\/
#
# 0: \x81
#updated to handle 16-bits utf8
/^ÿ/
ÿ
0: \xc3\xbf
/^[0-9]+$/
0
0: 0
1
0: 1
2
0: 2
3
0: 3
4
0: 4
5
0: 5
6
0: 6
7
0: 7
8
0: 8
9
0: 9
10
0: 10
100
0: 100
\= Expect no match
abc
No match
/^.*nter/
enter
0: enter
inter
0: inter
uponter
0: uponter
/^xxx[0-9]+$/
xxx0
0: xxx0
xxx1234
0: xxx1234
\= Expect no match
xxx
No match
/^.+[0-9][0-9][0-9]$/
x123
0: x123
x1234
0: x1234
xx123
0: xx123
123456
0: 123456
\= Expect no match
123
No match
/^.+?[0-9][0-9][0-9]$/
x123
0: x123
x1234
0: x1234
xx123
0: xx123
123456
0: 123456
\= Expect no match
123
No match
/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
abc!pqr=apquxz.ixr.zzz.ac.uk
0: abc!pqr=apquxz.ixr.zzz.ac.uk
1: abc
2: pqr
\= Expect no match
!pqr=apquxz.ixr.zzz.ac.uk
No match
abc!=apquxz.ixr.zzz.ac.uk
No match
abc!pqr=apquxz:ixr.zzz.ac.uk
No match
abc!pqr=apquxz.ixr.zzz.ac.ukk
No match
/:/
Well, we need a colon: somewhere
0: :
\= Expect no match
Fail without a colon
No match
/([\da-f:]+)$/i
0abc
0: 0abc
1: 0abc
abc
0: abc
1: abc
fed
0: fed
1: fed
E
0: E
1: E
::
0: ::
1: ::
5f03:12C0::932e
0: 5f03:12C0::932e
1: 5f03:12C0::932e
fed def
0: def
1: def
Any old stuff
0: ff
1: ff
\= Expect no match
0zzz
No match
gzzz
No match
fed\x20
No match
Any old rubbish
No match
/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
.1.2.3
0: .1.2.3
1: 1
2: 2
3: 3
A.12.123.0
0: A.12.123.0
1: 12
2: 123
3: 0
\= Expect no match
.1.2.3333
No match
1.2.3
No match
1234.2.3
No match
/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
1 IN SOA non-sp1 non-sp2(
0: 1 IN SOA non-sp1 non-sp2(
1: 1
2: non-sp1
3: non-sp2
1 IN SOA non-sp1 non-sp2 (
0: 1 IN SOA non-sp1 non-sp2 (
1: 1
2: non-sp1
3: non-sp2
\= Expect no match
1IN SOA non-sp1 non-sp2(
No match
/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
a.
0: a.
Z.
0: Z.
2.
0: 2.
ab-c.pq-r.
0: ab-c.pq-r.
1: .pq-r
sxk.zzz.ac.uk.
0: sxk.zzz.ac.uk.
1: .uk
x-.y-.
0: x-.y-.
1: .y-
\= Expect no match
-abc.peq.
No match
/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
*.a
0: *.a
*.b0-a
0: *.b0-a
1: 0-a
*.c3-b.c
0: *.c3-b.c
1: 3-b
2: .c
*.c-a.b-c
0: *.c-a.b-c
1: -a
2: .b-c
3: -c
\= Expect no match
*.0
No match
*.a-
No match
*.a-b.c-
No match
*.c-a.0-c
No match
/^(?=ab(de))(abd)(e)/
abde
0: abde
1: de
2: abd
3: e
/^(?!(ab)de|x)(abd)(f)/
abdf
0: abdf
1: <unset>
2: abd
3: f
/^(?=(ab(cd)))(ab)/
abcd
0: ab
1: abcd
2: cd
3: ab
/^[\da-f](\.[\da-f])*$/i
a.b.c.d
0: a.b.c.d
1: .d
A.B.C.D
0: A.B.C.D
1: .D
a.b.c.1.2.3.C
0: a.b.c.1.2.3.C
1: .C
/^\".*\"\s*(;.*)?$/
\"1234\"
0: "1234"
\"abcd\" ;
0: "abcd" ;
1: ;
\"\" ; rhubarb
0: "" ; rhubarb
1: ; rhubarb
\= Expect no match
\"1234\" : things
No match
/^$/
\
0:
\= Expect no match
A non-empty line
No match
/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
ab c
0: ab c
\= Expect no match
abc
No match
ab cde
No match
/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
ab c
0: ab c
\= Expect no match
abc
No match
ab cde
No match
/^ a\ b[c ]d $/x
a bcd
0: a bcd
a b d
0: a b d
\= Expect no match
abcd
No match
ab d
No match
/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
abcdefhijklm
0: abcdefhijklm
1: abc
2: bc
3: c
4: def
5: ef
6: f
7: hij
8: ij
9: j
10: klm
11: lm
12: m
/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
abcdefhijklm
0: abcdefhijklm
1: bc
2: c
3: ef
4: f
5: ij
6: j
7: lm
8: m
#/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
# a+ Z0+\x08\n\x1d\x12
# 0: a+ Z0+\x08\x0a\x1d\x12
/^[.^$|()*+?{,}]+/
.^\$(*+)|{?,?}
0: .^$(*+)|{?,?}
/^a*\w/
z
0: z
az
0: az
aaaz
0: aaaz
a
0: a
aa
0: aa
aaaa
0: aaaa
a+
0: a
aa+
0: aa
/^a*?\w/
z
0: z
az
0: a
aaaz
0: a
a
0: a
aa
0: a
aaaa
0: a
a+
0: a
aa+
0: a
/^a+\w/
az
0: az
aaaz
0: aaaz
aa
0: aa
aaaa
0: aaaa
aa+
0: aa
/^a+?\w/
az
0: az
aaaz
0: aa
aa
0: aa
aaaa
0: aa
aa+
0: aa
/^\d{8}\w{2,}/
1234567890
0: 1234567890
12345678ab
0: 12345678ab
12345678__
0: 12345678__
\= Expect no match
1234567
No match
/^[aeiou\d]{4,5}$/
uoie
0: uoie
1234
0: 1234
12345
0: 12345
aaaaa
0: aaaaa
\= Expect no match
123456
No match
/^[aeiou\d]{4,5}?/
uoie
0: uoie
1234
0: 1234
12345
0: 1234
aaaaa
0: aaaa
123456
0: 1234
/\A(abc|def)=(\1){2,3}\Z/
abc=abcabc
0: abc=abcabc
1: abc
2: abc
def=defdefdef
0: def=defdefdef
1: def
2: def
\= Expect no match
abc=defdef
No match
/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/
abcdefghijkcda2
0: abcdefghijkcda2
1: a
2: b
3: c
4: d
5: e
6: f
7: g
8: h
9: i
10: j
11: k
12: cd
abcdefghijkkkkcda2
0: abcdefghijkkkkcda2
1: a
2: b
3: c
4: d
5: e
6: f
7: g
8: h
9: i
10: j
11: k
12: cd
/(cat(a(ract|tonic)|erpillar)) \1()2(3)/
cataract cataract23
0: cataract cataract23
1: cataract
2: aract
3: ract
4:
5: 3
catatonic catatonic23
0: catatonic catatonic23
1: catatonic
2: atonic
3: tonic
4:
5: 3
caterpillar caterpillar23
0: caterpillar caterpillar23
1: caterpillar
2: erpillar
3: <unset>
4:
5: 3
/^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]/
From abcd Mon Sep 01 12:33:02 1997
0: From abcd Mon Sep 01 12:33
1: abcd
/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
From abcd Mon Sep 01 12:33:02 1997
0: From abcd Mon Sep 01 12:33
1: Sep
From abcd Mon Sep 1 12:33:02 1997
0: From abcd Mon Sep 1 12:33
1: Sep
\= Expect no match
From abcd Sep 01 12:33:02 1997
No match
/^12.34/s
12\n34
0: 12\x0a34
12\r34
0: 12\x0d34
/\w+(?=\t)/
the quick brown\t fox
0: brown
/foo(?!bar)(.*)/
foobar is foolish see?
0: foolish see?
1: lish see?
/(?:(?!foo)...|^.{0,2})bar(.*)/
foobar crowbar etc
0: rowbar etc
1: etc
barrel
0: barrel
1: rel
2barrel
0: 2barrel
1: rel
A barrel
0: A barrel
1: rel
/^(\D*)(?=\d)(?!123)/
abc456
0: abc
1: abc
\= Expect no match
abc123
No match
/^1234(?# test newlines
inside)/
1234
0: 1234
/^1234 #comment in extended re
/x
1234
0: 1234
/#rhubarb
abcd/x
abcd
0: abcd
/^abcd#rhubarb/x
abcd
0: abcd
/^(a)\1{2,3}(.)/
aaab
0: aaab
1: a
2: b
aaaab
0: aaaab
1: a
2: b
aaaaab
0: aaaaa
1: a
2: a
aaaaaab
0: aaaaa
1: a
2: a
/(?!^)abc/
the abc
0: abc
\= Expect no match
abc
No match
/(?=^)abc/
abc
0: abc
\= Expect no match
the abc
No match
/^[ab]{1,3}(ab*|b)/
aabbbbb
0: aabb
1: b
/^[ab]{1,3}?(ab*|b)/
aabbbbb
0: aabbbbb
1: abbbbb
/^[ab]{1,3}?(ab*?|b)/
aabbbbb
0: aa
1: a
/^[ab]{1,3}(ab*?|b)/
aabbbbb
0: aabb
1: b
/ (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* # optional leading comment
(?: (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) # initial word
(?: (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) )* # further okay, if led by a period
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* @ (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # initial subdomain
(?: #
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* \. # if led by a period...
(?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* (?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
| \[ # [
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
\] # ]
) # ...further okay
)*
# address
| # or
(?:
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
) # one word, optionally followed by....
(?:
[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
\(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) | # comments, or...
" (?: # opening quote...
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
| # or
\\ [^\x80-\xff] # Escaped something (something != CR)
)* " # closing quote
# quoted strings
)*
< (?: [\040\t] | \(
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
\) )* # leading <