Basic Information
Caption: Credit Card - MasterCard
Description: This classifier identifies MasterCard credit card numbers using a regular expression, relevant nearby terms and LUHN validation . It accommodates both hyphen-separated formats and non-delimited formats, ensuring coverage of all common variations.
Type: By content
Value Per Record: $100
Sensitive: Yes
Active: Yes
Regulations
- PCI
- FTC
Conditions
- Matches regex: (?:^|[^-+.,'\"#;:\w])(5[1-5][0-9]{14})(?![-+.,'\"#;:\w])|(?:^|[^-+.,'\"#;:\w])(5[1-5][0-9]{2}\-[0-9]{4}\-[0-9]{4}\-[0-9]{4})(?![-+.,'\"#;:\w])|(?:^|[^-+.,'\"#;:\w])((222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[0-1]\d|2720)[0-9]{12})(?![-+.,'\"#;:\w])|(?:^|[^-+.,'\"#;:\w])((222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[0-1]\d|2720)\-[0-9]{4}\-[0-9]{4}\-[0-9]{4})(?![-+.,'\"#;:\w])
- Nearby Words: "MasterCard, credit, CCN, CRV, CCV, Exp"
- Validation Method: LUHN
Regular Expression Description
This regex detects a 16-digit number starting with 5, followed by 14 numeric digits (0–9). It can be non-delimited 16-digit or a hyphenated format (e.g., 5555-5555-5555-4444). To reduce false positives, the rule also requires the presence of nearby terms such as "credit," "CCN," "CRV," "CCV," or "Exp." and LUHN validation.
To check if a string matches this regular expression, use Regex101.