3 ms·
> Tangentally, there's no point validating email addresses with anything more complicated than /@/ Well once you have this in database, maybe you'll give it to
by comboy 10y ago
> Tangentally, there's no point validating email addresses with anything more complicated than /@/
Well once you have this in database, maybe you'll give it to some library, then maybe this poor little library will just paste it into the SMTP conversation. And maybe some user will be clever enough to exploit it.
I believe that if you want to get X from the user, it's always a good idea to make super sure that it is actually X before passing it further.
And I very much agree that whenever possible and necessary, simply splitting regular expression to multiple lines and using comments seems like a superior approach.
- Retra 10y agoThe point is not to parse email addresses with regex because an actual email parser is far more appropriate for the task.