Friday, 20 January 2012

Regular expression regex for validating email addresses

I've seen a few of these in my time, but this one has been serving me well...found in Michael Hartl's Rails book:
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!