Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does it fail? I don't see ^ or $.


The regexp looks for exactly one '@'-character preceded and followed by at least one character that's not an '@'-character. Or, in other words, it does not allow for an email address with more than one '@'-character.


The point of the post was that since the regexp doesn't include start or end of a string it would still succeed:

"Foo@bar"@example.com -> "Foo@bar"


I assumed it was anchored and he missed those off.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: