regex static method

ValidationRule<String> regex(
  1. RegExp regex, {
  2. String? message,
})

Creates a Regex validation rule.

This rule checks if a string matches the specified regex. It can include a custom validation message.

Implementation

static ValidationRule<String> regex(RegExp regex, {String? message}) =>
    Regex(regex, message: message);