Skip to content

Instantly share code, notes, and snippets.

@flacodirt
Created March 25, 2013 13:41
Show Gist options
  • Save flacodirt/5237180 to your computer and use it in GitHub Desktop.
Save flacodirt/5237180 to your computer and use it in GitHub Desktop.
Credit card validation regular expressions
/**
* Credit card validation regular expressions
*/
# American Express
/^3[47]/
# Visa
/^4/
# Mastercard
/^5[1-5]/
# Discover
/^6(?:011|44|5[0-9]{2})/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment