Created
November 24, 2020 18:33
-
-
Save luisenriquecorona/02ac5f31a868dcce808a2fb2443217fc to your computer and use it in GitHub Desktop.
Passphrase.js
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
var input = prompt("Please enter a pass phrase.", ""); | |
function isValid (text) { | |
var myRegExp = /[^a-z\d ]/i; | |
return !(myRegExp.test(text)); | |
} | |
if (isValid(input)) { | |
alert("Your passphrase contains only valid characters"); | |
} else { | |
alert("Your passphrase contains one or more invalidcharacters"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sharing