Other Resources:
Diners Club credit card number validation
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 digits. For example, 38520000023237 is a valid Visa credit card number.
How to write a single regular expression to validate a Diners Club credit card number described above?
✍: FYIcenter.com
Here is the regular expression to validate a Diners Club credit card number:
^3(?:0[0-5]|[68][0-9])[0-9]{11}$
^ - begin of the string
3 - matches 3
(?:0[0-5]|[68][0-9]) - non-capturing group of 2 possible parts
0[0-5] - 2 digits of 00, 01, 02, 03, 04 or 05
| - or operator
[68][0-9] - 2 digits start with 6 or 8
[0-9] - any decimal digit
{11} - repeating 12 times
$ - end of the string
2024-01-10, 0👍, 1💬
Popular Posts:
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 Diners Club must start with 300 through 305, 36 or 38 and have 14 ...
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 American Express must start with 34 or 37 and have 15 digits. For ...
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 ...