matches<E> static method
Validates that the string matches the given pattern.
StringRules.matches(
RegExp(r'^[a-zA-Z0-9_]+$'),
error: 'Only alphanumeric and underscore allowed',
)
Implementation
static Rule<String, E> matches<E>(RegExp pattern, {required E error}) =>
PredicateRule(
predicate: (value) => pattern.hasMatch(value),
error: error,
);