regexFilter property

RegExp get regexFilter

A regular expression that defines the allowed characters for input.

By default, this allows any combination of letters and numbers.

Example:

RegExp(r'[a-zA-Z0-9]'); // input: "abc123" | output: "abc123"

To allow only numbers:

Example:

RegExp(r'[0-9]'); // input: "abc123" | output: "123"

This regular expression can be adjusted to restrict the input to specific character sets (e.g., alphanumeric only, letters and numbers with hyphens, etc.).

Implementation

RegExp get regexFilter => RegExp(r'[a-zA-Z0-9]');