Created
August 26, 2020 12:33
-
-
Save iamlucianojr/9aee3210b9ff3ae2405d0a358cd57ce6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Function to check letters and numbers | |
function alphanumeric(senha) { | |
var letterNumber = /^[0-9a-zA-Z]+$/; | |
if (senha.match(letterNumber)) { | |
return true; | |
} | |
return false | |
} | |
if (alphanumeric('Raiza^')) { | |
console.log('Possui apenas letras ou números') | |
} else { | |
console.log('Possui caracteres que não são letras ou números') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment