customRegexValidator static method
Implementation
static String? customRegexValidator(String? value, String pattern, String errorMessage) {
final regex = RegExp(pattern);
if (!regex.hasMatch(value ?? '')) {
return errorMessage;
}
return null;
}