TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Stop Validating Email Addresses With Your Complex Regexes

46 点作者 cyen超过 12 年前

9 条评论

jyap超过 12 年前
There's got to be a bug because this was on the front page 6 days ago: <a href="http://news.ycombinator.com/item?id=4486108" rel="nofollow">http://news.ycombinator.com/item?id=4486108</a><p>Well the link in the previous post had a trailing slash.
评论 #4518397 未加载
评论 #4518240 未加载
评论 #4518207 未加载
ry0ohki超过 12 年前
One suggestion I would add: Let them in right now, and confirm later. Sites that require you to wait for an email, click a validation link etc... have a higher barrier to entry. Sometimes email is slow, sometimes it ends up in spam, etc...<p>Just let the users in at first to poke around before forcing them to validate their email. After a day or two (or maybe to access certain features) remind them they need to confirm that email they got if they haven't already. Yes, some people may try your product and you won't have their real email address, the the ROI on spamming these people later is probably not worth the initial friction.
jere超过 12 年前
If you've been developing login systems for any length of time, this should be fairly obvious.<p>Be careful about taking that "it’ll get bounced" attitude too far though. The last time I did so I forgot to trim the email addresses and didn't lowercase them. Failing to trim will probably result in the email going through, but then might cause problems later on when you try to match their login ID to what they enter the next time.<p>A similar issue arises for case. Email addresses are <i>supposed</i> to be case sensitive but providers don't seem to take advantage of it in practice. Again, the case a user types varies from time to time (I assumed nobody used upper case... it seems silly). And if you switch to case insensitive login IDs down the line, you may have to deal with duplicate accounts (same email but different case).
评论 #4518416 未加载
ericd超过 12 年前
Following this advice creates a lot of "I never got my activation email" and "Why won't it let me log in" support emails that are a big pain to deal with. It's pretty important to nip that in the bud, hence immediate email address validation.
leeoniya超过 12 年前
we've been doing full mx lookups and smtp RCPT TO: queries for some time.<p>beware: yahoo's smtp servers always say addresses are valid...making validation quite pointless.
egiva超过 12 年前
I couldn't help thinking while reading this that my main concern with registration systems isn't the complicated Regex as much, but rather the really annoying registry bots that sign up phantom accounts. I'm not a huge Captcha fan, but without something (Recaptcha, ghosted fields, etc) you'll get SPAMMED with tons of fake accounts - and they have valid emails, AND the bots click on the links in the confirmation email automatically. It's really sad.
评论 #4518502 未加载
评论 #4518454 未加载
TomatoTomato超过 12 年前
What about just checking if a MX record exists?
评论 #4518460 未加载
tete超过 12 年前
HTML 5 input fields support it now (if you want to do it for the user input).
madprops超过 12 年前
I just check if there's a @
评论 #4518359 未加载