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.
API
function pattern<TPathKind extends PathKind = PathKind.Root>(
path: SchemaPath<string, 1, TPathKind>,
pattern: RegExp | LogicFn<string | undefined, RegExp | undefined, TPathKind>,
config?: BaseValidatorConfig<string, TPathKind> | undefined,
): void;Jump to details