match static method

FormFieldValidator<String> match(
  1. RegExp regex, {
  2. String? errorText,
  3. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to match the provided regex pattern.

Parameters:

  • regex The regex pattern to match.
  • errorText The error message when the value does not match the pattern.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<String> match(
  RegExp regex, {
  String? errorText,
  bool checkNullOrEmpty = true,
}) => MatchValidator(
  regex,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;