Javascript Email Validation

Needed to update my validation scripts and found this excellent article on the subject.
The key part I needed was this:
var reEmail = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

which basically says, the first & second parts must have only letters, numbers, underscores, hyphens, or periods, with an @ symbol between them, then the last part must have only letters and there must be at least 2 and no more than 4.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *