Created
January 26, 2022 18:15
-
-
Save jx13xx/1f24ef0c82b7b392d0c3459d5fd4ffe5 to your computer and use it in GitHub Desktop.
EmailValidationCheck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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