Other Resources:
Visa credit card number validation
All credit card numbers issued by Visa must start with a 4 and have 13 or 16 digits. For example, 346997719493686 is a valid Visa credit card number.
How to write a single regular expression to validate a Visa credit card number described above?
✍: FYIcenter.com
![]()
Here is the regular expression for Visa credit card number validation:
^4[0-9]{12}(?:[0-9]{3})?$
^ - begin of the string
4 - matches 4
[0-9] - any decimal digit
{12} - repeating 12 times
(?:[0-9]{3}) - non-capturing group of 3 digits
? - match previous group 1 time or nothing
$ - end of the string
2013-01-22, 0👍, 0💬
Popular Posts:
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 ...
Are you having problems using regular expressions when processing text strings in your applications ...
A free online regular expression test tool that allows to try you regular expression pattern and see...
How to capture the MSN (Microsoft Network) bot entries from Web log file? Here are some Web log file...
All credit card numbers issued by American Express must start with 34 or 37 and have 15 digits. For ...