Binds a validator to the given path that requires the value to match a specific regex pattern.
This function can only be called on string paths.
In addition to binding a validator, this function adds PATTERN property to the field.
pattern
voidBinds a validator to the given path that requires the value to match a specific regex pattern.
This function can only be called on string paths.
In addition to binding a validator, this function adds PATTERN property to the field.
@parampath
{ [ɵɵTYPE]: [string, TPathKind]; }Path of the field to validate
@parampattern
RegExp | LogicFn<string | undefined, RegExp | undefined, TPathKind>The RegExp pattern to match, or a LogicFn that returns the RegExp pattern.
@paramconfig
BaseValidatorConfig<string, TPathKind> | undefinedOptional, allows providing any of the following options:
error: Custom validation error(s) to be used instead of the defaultValidationError.pattern(pattern)or a function that receives theFieldContextand returns custom validation error(s).
@returns
voidJump to details