2 ms·
Just... don't try to validate it like that. Check if you can send an e-mail to it, if you can then it's fine. I see way too many devs thinking they can validate
by Avamander 7y ago
Just... don't try to validate it like that. Check if you can send an e-mail to it, if you can then it's fine. I see way too many devs thinking they can validate e-mails with regex and then I can't use my own name in my e-mail.
- iudqnolq 7y agoI agree completely. I might do .+@.+\..+ on the frontend to catch people mixing up usernames and emails, but that's it. You might not be surprised that regex comes from a Perl module :)
- Avamander 7y agoTo be honest, login forms should take both username and e-mail as the user identifier, far too often they don't. I personally think that the only place where such a regex should exist is during sign-up.
- iudqnolq 7y agoFair enough, although you could I suppose run into issues doing that retroactively if you allowed `@` in usernames...