Press "Enter" to skip to content

Posts published in November 2013

Validate Email Address in Javascript

Below is a nice little Javascript RegularExpression to validate email addresses. [code lang=”javascript”] /^\[email protected][a-zA-Z_.]+?\.[a-zA-Z.]{2,3}$/ [/code] ..and to use it.. [code lang=”javascript”] if (/^\[email protected][a-zA-Z_.]+?\.[a-zA-Z.]{2,3}$/.test(email)) alert(“Success”); else alert(“Fail”); [/code]