On Thu, 19 Mar 2020 13:18:58 -0000 (UTC),
Martin Gregorie , in
wrote:
> So, can any of you do better, i.e. write a regex that CAN validate the
> syntax of an e-mail address in terms of its structure and the set of
> permitted characters on the username and domain parts (the permitted
> character sets are not the same).
You're already in a state of regex sin. There are far too many
exceptions to the rules with respect to an email address. The "+" is a
sendmail construct, and has been replicated in postfix and possibly
(likely?) present in other MTAs.
The domain portion is much smaller match space, but the username
portion permits all characters ***if they're properly escaped***.
This is a thorny problem, and has been with us ever since someone put
a webform asking for an email address on the web, and thought sanity
checking the address was a good idea. In theory, a great idea, but in
practice it will drive you to drink.
--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|