You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The regex '^\w+\@\w+\.[a-z]{2,3}$' is far too restrictive, as it doesn't allow for some very common things in emails, such as periods, dashes, plusses, etc.
I learned a long time ago to not even try to fully validate an email address just via regex. It's not really possible since you don't know if the domain really exists, or whether there is a mail server configured for that domain, and then of course, even if all that checks out, you don't know if that specific user exists on that server without trying to send an email there.
So, in conclusion, the email validator should really just be a basic sanity check along the lines of '^[^@]+\@[^@]+$' since users of the library are going to have to do further validation anyway, perhaps using something like Flanker's addresslib or just by sending a verification email.
The text was updated successfully, but these errors were encountered:
The regex
'^\w+\@\w+\.[a-z]{2,3}$'
is far too restrictive, as it doesn't allow for some very common things in emails, such as periods, dashes, plusses, etc.[email protected]
fails validation, as does[email protected]
,[email protected]
.[email protected]
passes, at least. All of these should pass, however.I learned a long time ago to not even try to fully validate an email address just via regex. It's not really possible since you don't know if the domain really exists, or whether there is a mail server configured for that domain, and then of course, even if all that checks out, you don't know if that specific user exists on that server without trying to send an email there.
So, in conclusion, the email validator should really just be a basic sanity check along the lines of
'^[^@]+\@[^@]+$'
since users of the library are going to have to do further validation anyway, perhaps using something like Flanker's addresslib or just by sending a verification email.The text was updated successfully, but these errors were encountered: