validatePattern static method
Implementation
static String? validatePattern(
String value, {
required String label,
required String pattern,
String? errorMessage,
}) {
if (value.trim().isEmpty) return emptyMessage;
if (hasMatch(pattern: pattern, value: value)) return null;
return errorMessage ?? '$enterValid $label';
}