isMasterCard static method
Implementation
static String? isMasterCard(String? value) {
final inputValue = value ?? "";
final regex = RegExp(
r'^(5[1-5]\d{14}|2(2[2-9][1-9]\d{12}|2[3-9]\d{13}|[3-6]\d{14}|7[0-1]\d{13}|720\d{12}))$',
);
return regex.hasMatch(inputValue)
? null
: "Must start with 51-55 or \n 2221-2720 and be 16 digits.";
}