Created
May 14, 2017 19:36
-
-
Save capJavert/f7a4fd45eafcd2ba3fa3a510434bb8cc to your computer and use it in GitHub Desktop.
Credit cards Regex
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
| ^(?:4[0-9]{12}(?:[0-9]{3})? # Visa | |
| | (?:5[1-5][0-9]{2} # MasterCard | |
| | 222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12} | |
| | 3[47][0-9]{13} # American Express | |
| | 3(?:0[0-5]|[68][0-9])[0-9]{11} # Diners Club | |
| | 6(?:011|5[0-9]{2})[0-9]{12} # Discover | |
| | (?:2131|1800|35\d{3})\d{11} # JCB | |
| )$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment