3 ms·
...probably a lot that are written by those who do not care enough to read RFCs. I was recently asked on an interview to write regex that grabs "valid" e-mail a
by seanp2k2 14y ago
...probably a lot that are written by those who do not care enough to read RFCs. I was recently asked on an interview to write regex that grabs "valid" e-mail addresses. I asked if I could review the RFC so I could write useful regex. I was denied, and I ended up totally uninterested in this trendy company with amateurish standards.
- w1nk 14y agoSlightly off topic, but even with access to the RFC you weren't likely to get that one right. Validating any email address correctly with a regex is nearly impossible (a canonical example of the horror: http://ex-parrot.com/~pdw/Mail-RFC822-Address.html http://ex-parrot.com/~pdw/Mail-RFC822-Address.html and even that one has a limitation or 2). I think the only correct answer to that question is to suggest an alternative to a regular expression. It could be that was the answer they were looking for.
- jmillikin 14y agoThat seems like a really easy regex to write. .+@.+\..+ (note: I haven't reviewed the RFC, so this might be too strict)