progs/email-rexp
author Christian Urban <christian.urban@kcl.ac.uk>
Tue, 17 Nov 2020 00:36:16 +0000
changeset 806 0d3bc1d0d987
parent 244 771042ac7c3f
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
244
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
 \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
)*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
 \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\"
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    62
:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    70
 \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    75
\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    77
"()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    78
*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    79
+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    80
.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    81
|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    82
?:\r\n)?[ \t])*))*)?;\s*)