How many times have you wished that some build-in checks existed in the Regular Expression object? One on the ones which I use often is a check if an e-mail address is valid - so here you are! You may use it as you like! :-)
function isValidEmail(sEmail)
{
var pattern = "^[a-zA-Z0-9._+&*# -]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$"
var regex = new RegExp(pattern, 'ig');
return regex.test(sEmail);
}
Friday, February 8, 2008
isValidEmail(sEmail)
By
Sten Hougaard
on
Friday, February 08, 2008
Etiketter: Dynamic Web CMS, Javascript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment