View Full Version : Javascript e-mail validation

September 21st, 2008, 04:51 PM
When i search js code for a email validation, i found the following pattern is used to validate the given email address using "test()" method. Can anybody explain me the following code?

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

September 21st, 2008, 07:38 PM
It's a regular expression. See Regular expressions in JavaScript (http://www.devarticles.com/c/a/JavaScript/Regular-expressions-in-JavaScript/), or Google for it to find more information.