customRegexValidation static method
自定义正则验证
Implementation
static bool customRegexValidation(String? text, String pattern) {
if (text?.isEmpty ?? true) return false;
try {
final regex = RegExp(pattern);
return regex.hasMatch(text!);
} catch (e) {
return false;
}
}