Regex constructor

Regex(
  1. RegExp regex, {
  2. String? message,
})

Creates a new instance of the Regex validation rule.

  • regex: The regular expression pattern to match against (required).
  • message: A custom validation message (optional) to be displayed when the validation fails.

Implementation

Regex(this.regex, {String? message}) : super(message);