Updated 7/27/2018
^(?![.!#$%&'*+/=?^_`{|}~-])(?:[a-zA-Z0-9]|(?:(?:([.])(?!\1)|[!#$%&'*+/=?^_`{|}~-]))(?!@)){1,64}@(?=.{1,255}$)(?!\d+$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
https://regex101.com/r/dxCmEn/1
^ # BOS
(?! [.!#$%&'*+/=?^_`{|}~-] ) # Local does not start with one of these
(?: # Local
[a-zA-Z0-9]
|
# Special chars
# Local does not end with one of these
(?:
# Option 1
(?:
( [.] ) # (1), Not a consecutive special char (specific), add more
(?! \1 ) #
| # or,
[!#$%&'*+/=?^_`{|}~-] # One of these other special chars, remove from here
)
# Option 2
# | ( [.!#$%&'*+/=?^_`{|}~-] ) # (1) Not a consecutive same special char
# (?! \1 )
# Option 3
# | [.!#$%&'*+/=?^_`{|}~-] # Not a consecutive any special char
# (?! [.!#$%&'*+/=?^_`{|}~-] )
# Option 4, Original
# | [.!#$%&'*+/=?^_`{|}~-] # Any special char is OK
#
)
(?! @ )
){1,64} # 1 to 64 local characters
@
(?= .{1,255} $ ) # 1 to 255 domain characters
(?! \d+ $ ) # Domain must not contain all numbers
[a-zA-Z0-9] # Domain
(?:
[a-zA-Z0-9-]{0,61}
[a-zA-Z0-9]
)?
(?:
\.
[a-zA-Z0-9]
(?:
[a-zA-Z0-9-]{0,61}
[a-zA-Z0-9]
)?
)*
$ # EOS