Skip to content

Instantly share code, notes, and snippets.

@emohamed
Created November 27, 2014 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emohamed/610750cfa72facdb42d9 to your computer and use it in GitHub Desktop.
Save emohamed/610750cfa72facdb42d9 to your computer and use it in GitHub Desktop.
<!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