Other Resources:
Discover credit card number validation
All credit card numbers issued by Diners Club must start with 6011 or 65 and have 16 digits. For example, 6011186767363105 is a valid Visa credit card number.
How to write a single regular expression to validate a Discover credit card number described above?
✍: FYIcenter.com
Here is the regular expression to validate a Discover credit card number:
^6(?:011|5[0-9]{2})[0-9]{12}$
^ - begin of the string
6 - matches 6
(?:011|5[0-9]{2}) - non-capturing group of 2 possible parts
011 - matches 011
| - or operator
5[0-9]{2} - 3 digits start with 5
[0-9] - any decimal digit
{12} - repeating 12 times
$ - end of the string
2021-02-13, 0👍, 3💬
Popular Posts:
A free online regular expression test tool that allows to try you regular expression pattern and see...
How to capture the Sogou web spider entries from Web log file? Here are some Web log file entries: 1...
All credit card numbers issued by MasterCard must start with 51 through 55 and have 16 digits. For e...
How to capture the Sogou web spider entries from Web log file? Here are some Web log file entries: 1...
All credit card numbers issued by MasterCard must start with 51 through 55 and have 16 digits. For e...