Email Validation RegExp
November 2nd, 2007 at 15:40 (JavaScript, Regular Expressions)
I had to search my desktop files and email history for forty minutes before I turned this up:
var rfc2822 = /^[\w!#$%&'*+/=?^`{|}~-]+(?:\.[\w!#$%&'*+/=?^`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])*)+\.(?:[a-z]{2,4}|museum|travel)$/i;
That’s a JavaScript variable declaration, but the RegExp is valid for Perl and can be quickly translated for other languages.
pyrolupus said,
November 13, 2007 at 16:18
For anyone following along, I missed a plus sign in there. Fixed, now.
Pyro