Wednesday, 21 March 2012

JavaScript Email Validation through Regular Expression

function ValidateEmail(str){    
    var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;        
    return emailPattern.test(str);   
}

No comments:

Post a Comment