Validates that the specified value matches an regular expression. If pattern is a string, then a regex is created with new RegExp(pattern).
pattern
new RegExp(pattern)
regex(/^[0-9a-z_]+$/i) regex("^[0-9a-zA-z_]+$") regex(/^[0-9a-z_]+$/i, {message: "must be a valid username"})
useForm(({confirm}) => ({ email: [regex(/^\S+@\S+$/)] }));
The expected pattern.
The validator options.
The validation object.
Generated using TypeDoc
Validates that the specified value matches an regular expression. If
pattern
is a string, then a regex is created withnew RegExp(pattern)
.regex(/^[0-9a-z_]+$/i) regex("^[0-9a-zA-z_]+$") regex(/^[0-9a-z_]+$/i, {message: "must be a valid username"})
useForm(({confirm}) => ({ email: [regex(/^\S+@\S+$/)] }));