matches method
Implementation
JarString matches(String pattern, [String? message]) {
final regex = RegExp(pattern);
return addValidator((value) {
if (value == null) return null;
return regex.hasMatch(value) ? null : (message ?? 'Invalid format');
});
}