[UA-discuss] Regular Expression To Validate EAI Addresses

John Levine john.levine at standcore.com
Fri Aug 14 16:13:03 UTC 2020


In article <58D262E2-7B30-4F9B-882F-49865CDC4B2A at governanceprimer.com> you write:
>-=-=-=-=-=-
>-=-=-=-=-=-
>
>Abdel, thank you greatly for this.
>
>One of the coders at Governance Primer has been studying that code since you showed it on the EAI call, and came up
>witht he following variant:
>
>^(([\p{L}.%+-]+@[\p{L}.-]+\.[\p{L}]{2,})|([\p{L}]{2,}\.[\p{L}.-]+@[\p{L}.%+-]+))$
>
>What do you think about this one?

I don't understand what this one is trying to do but it's clearly wrong since
it allows % in host names.

If it's trying to handle RTL scripts, your coder misunderstands the
way RE matching works. It matches characters in the order they're
stored, not the order they're displayed.

-- 
Regards,
John Levine, johnl at taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly


More information about the UA-discuss mailing list