3 ms·
You could 'accidentally' prevent it by enforcing some incorrect regexp like [a-zA-Z0-9]@[a-z.]+ Not allowing a '+' to appear in the local part is not even that
by contravariant 2y ago
You could 'accidentally' prevent it by enforcing some incorrect regexp like [a-zA-Z0-9]@[a-z.]+
Not allowing a '+' to appear in the local part is not even that unreasonable. It's against the standard, but then "My email is this@example.com"@example.com is valid according to the standard so take the standard with a grain of salt.
- Timon3 2y agoWhat's the issue with "My email is this@example.com"@example.com? Why disallow it, or use it to argue that the standard isn't good?
- throw0101d 2y ago> Why disallow it, or use it to argue that the standard isn't good? Because lots of folks fat finger their own e-mail addresses and then complain that a 'site sucks' because signing up doesn't work. Sanity checking to protect people against themselves may be treated as a form of UX: it's probably why some forms insist you type (not copy-paste) your e-mail twice.
- xp84 2y agoI'm perpetually flabbergasted by how anyone thinks this "no pasting" thing is a pro-accuracy idea. As though people would be copying from a bad source. I see this a lot on forms for bank account numbers -- maybe one of the least amenable formats to visually copying down and retyping, since they're never written with delimiters or punctuation. I store them in my password manager, and then some idiotic form wants me to type my 18-digit bank account number, twice, on my phone, where I can't see more than one application at a time.
- contravariant 2y agoIt's just to illustrate that the standard is more complicated than people might realise. I think you'll have problems getting most systems to accept an email address with two @s in it, but I might be wrong. Either way it would definitely break some (not too well written) code. Though if possible I'd err on the side of being too permissive rather than too restrictive. In the end the only true way to validate an address is to send it an email.
- codetrotter 2y agohttps://www.rfc-editor.org/rfc/rfc5322.html https://www.rfc-editor.org/rfc/rfc5322.html This is the standard. “Taking it with a grain of salt” results in broken websites and servers that reject valid mail addresses.