pattern static method
Fails when the value does not match pattern.
Implementation
static PrismValidator pattern(RegExp pattern, [String? message]) => (value) {
final v = value ?? '';
if (v.isEmpty) return null; // let `required` handle emptiness
return pattern.hasMatch(v) ? null : (message ?? 'Invalid format');
};