Other Resources:
MasterCard credit card number validation
All credit card numbers issued by MasterCard must start with 51 through 55 and have 16 digits. For example, 5271190242643112 is a valid MasterCard credit card number.
How to write a single regular expression to validate a MasterCard credit card number described above?
✍: FYIcenter.com
![]()
Here is the regular expression for MasterCard credit card number validation:
^5[1-5][0-9]{14}$
^ - begin of the string
5 - matches 5 itself
[1-5] - 1, 2, 3, 4, or 5
[0-9] - any decimal digit
{14} - repeating 14 times
$ - end of the string
2013-01-22, 0👍, 0💬
Popular Posts:
Are you having problems using regular expressions when processing text strings in your applications ...
According to the IEEE 802 specification, a MAC address has 6 groups of 2 hexadecimal digits separate...
How to write a regular expression to parse key-value entries from Windows .INI files? Here is an exa...
Are you having problems using regular expressions when processing text strings in your applications ...
According to the IEEE 802 specification, a MAC address has 6 groups of 2 hexadecimal digits separate...