Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If I had a nickel for every time some non-technical fuckwit insisted we use a non-standards oriented metric for email validation, I wouldn't need VC money.
-
@SortOfTested not even joking, the email verification for one of the projects I saw at work?
.contains("@") -
Afaik there's no standard regex reliably validating an email. There are good-enough attempts tho... Even apache's validator has flaws
-
@AlgoRythm
To be honest: If you do verification by email, just cheking for "@" actually is enough.
The email standard is one of the first internet standards and therefore contains some traps and outdated crap nobody uses anymore (source paths, quoted dot-separated atoms, comments in the local part - yep, i WTFed too).
I never saw a fully standard-complient validation routine.
And i would actually advice against trying to be full standards-compliant anyway.
Don't allow quoted parts, comments, or source routes. They don't exist in the wild and only add more complexity for literally no gain.
But definitely allow top-level domains and IP-addresses. There are people having such addresses. -
@Oktokolo Yeah, but just "@" is not a valid email address.... I would hope at the very least match a regex like
/.+@.+/ -
jeeper58094y@netikras if theres anything that is better than the 99% that emailregex.com gets then it’s gonna come out of an academic research environment, not some cheap web app. 99% of devs need to just use that
-
@jeeper
Fails for international local parts and domains.
https://en.wikipedia.org/wiki/...
Fails also for toplevel domains.
I think, just checking for "@" literally is better than that page-long regexp. No, i am not an academic. -
nibor48134yThere's at least one major UK bank that doesn't accept emails blah@blah.wales or blah@blah.cymru
-
@nibor
Grats, you found someone who didn't just copypasted some ominous regexp from emailregex.com he didn't even dared trying to understand what it does... No, that one even got the extra mile and added a TLD whitelist to his code stew. -
@eval
I don't know your experience with folks working for TLD providers. But they can have email addresses in the form of "joedoe@com".
Most don't, but that might change with the proliferation of commercial TLDs.
And yes: You can use an IP address as a host name - even for email.
Never saw one myself, but i see no reason to block them. -
What is the worst that can happen if you accept an illegal email anyway? Assuming that you otherwise follow basic security procedures.
-
@Lor-inc
An email doesn't reach any person or reaches the wrong person.
So it is the same as it is for postal addresses or telefax numbers. -
@Oktokolo In that case why bother, when I can give "yomama@fuckoff.com" and bypass any regex?
The only real test is email verification, and it's so much simpler as well. If you really want to, you can check if it vaguely resembles an email. I.e. contains a @. -
Btw my hobby is feeding addresses like 0@gmail.com to WiFi walls in the hopes that they get flagged as spam.
-
@Lor-inc
The whole email syntax check fetish actually has a solid and reasonable root:
Making users aware about the fact, that they just pasted something completely unrelated into the email field.
Just checking for the "@" catches indeed most of that.
A lot of sites let users fill two fileds with the same address to get better error detection, but users normaly just copy the address from field 1 and paste it into field two - so it always matches regardless of typos...
Do WiFi hotspots now actually send any emails?
I always thought, they are just hording emails so the can mark the "you have to get something identifying the user in case he uses your WiFi to rape a child" checkbox. -
Linux434834y@devapsarl
It is quite common for people to just have everything behind the same IP, and therefore only the A Record is needed, technically
Related Rants
Yes you can have hyphens in email addresses, you incompetent nincompoops!!! Just use the standard regex for email validation and stop trying to make your own rules!!!!
rant
dumb
emails
front end