Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to validate an email addres
//FUNCTION TO VALIDATE AN EMAIL ADDRESS
//USAGE: Ej:, validate_email(josedaniel.paterninasoto@gmail.com);
//This will return TRUE if the email is valid or FALSE if not.
function validate_email(email){
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
return(true);
}else{
return(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.