2 ms·
As others have suggested, the best "standardised regex" solution would just be something like: /.*@.*/ Some people aren't happy with this because it allow
by tom-lord 12y ago
As others have suggested, the best "standardised regex" solution would just be something like:
/.*@.*/
Some people aren't happy with this because it allows invalid emails to be entered. But the alternative - such as what's being attempted here - is a nightmare!
Even if there was a standardised regex for all emails, which would not break when new TLDs are released, or new unicode characters are supported, or whatever, there would still be no guarantee that someemailaddress@domain.com is actually valid!
Your best bet is to simply allow users to enter anything (with perhaps some minor regex check like I did above), perhaps ask them to enter it twice, and perhaps send an account validation email.