Skip to content

Instantly share code, notes, and snippets.

@jx13xx
Created January 26, 2022 18:15
Show Gist options
  • Save jx13xx/1f24ef0c82b7b392d0c3459d5fd4ffe5 to your computer and use it in GitHub Desktop.
Save jx13xx/1f24ef0c82b7b392d0c3459d5fd4ffe5 to your computer and use it in GitHub Desktop.
EmailValidationCheck
let cases = {
'firstName' : 'FirstName',
'lastName' : 'LastName',
'email': '[email protected]',
'salary': 500235
}
const verifiedEmail = !!cases["email"].match(/([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/)
// OR
function isValidEmail(employeeEmail){
return !!employeeEmail.match(/([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment