Skip to content

Instantly share code, notes, and snippets.

@BriceShatzer
Created May 4, 2015 19:03
Show Gist options
  • Save BriceShatzer/7f789cd31a6110b64eac to your computer and use it in GitHub Desktop.
Save BriceShatzer/7f789cd31a6110b64eac to your computer and use it in GitHub Desktop.
angular-credit-cards issue
Possible issue within https://github.com/bendrucker/angular-credit-cards
Credit Card pattern regex is too inclusive
This allows
changing to [0-9\s\-]
still allows for spaces and dashes(something that is implied to be allowed by the docs) but prevents other characters.
Currently, all characters are allowed as long as they fall in amongst a valid card number.
601tacos are delicious111111abcefg1111117 is accepted as a valid credit card
this, in it's self isn't an issue
but it creates a disconnect between what is shown in the input field and what the actual value stored in the model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment