javascript function - validate email address

From WebHostingNeeds.com
Jump to: navigation, search
function isEmail(x){
    var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (x.match(re))
        return true;
    else{
        alert ("Invalid email address");
        return false;
    }    
}