4 ms·
I've always just used /^.+@.+\..+$/ That is, "Some characters, an @, some more characters, and a period" I couldn't care less if users want to enter undeli
by toomanybeersies 5y ago
I've always just used
/^.+@.+\..+$/
That is, "Some characters, an @, some more characters, and a period"
I couldn't care less if users want to enter undeliverable email addresses, they won't get emails. All that regex is intended to achieve is ensuring that the user hasn't accidentally filled the wrong field (e.g. tried entering their phone number) or mistyped a punctuation mark (foo#bar.com, foo@bar,com)
Strictly speaking, it won't match some valid email addresses, such as IPV6 domains. But if I receive a support ticket complaining that we don't accept email addresses with IPv6 address domain, I'll reply advising that the customer should purchase a domain name or sign up to one of many free email services.