Created
November 27, 2014 16:08
-
-
Save emohamed/610750cfa72facdb42d9 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Credit Card Numbers Normalization Example</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
function isValidNumber(number) { | |
return /enter-your-regex-here/.test(number); | |
} | |
console.log(isValidNumber('000 000 0000')); // should be true | |
console.log(isValidNumber('this is invalid number')); // should be false | |
console.log(isValidNumber('my number is 000 000 0000')); // should be false | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment