match method

Validator match(
  1. Pattern pattern, {
  2. String? errorMessage,
})

Adds a MatchRule to the validator.

The pattern is the regular expression pattern to match. The errorMessage is the optional error message to display if validation fails.

Implementation

Validator match(Pattern pattern, {String? errorMessage}) {
  addRule(MatchRule(pattern, errorMessage: errorMessage));
  return this;
}