validatePattern

Mask
stable

Run a named or custom validator against an unmasked string. Named validators (e.g. "numeric", "alpha") are looked up in the built-in VALIDATORS registry; unknown names throw to catch typos early.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

unmasked
requis
string
The raw value after mask characters have been stripped (output of unmaskValue).
validator
requis
TPatternValidator
Either a named validator string (e.g. "numeric", "alpha", "alphanumeric") or a custom (s: string) => boolean function.

API

Valeur de retour

La valeur retournée par cet util.

true when the unmasked value satisfies the validator, false otherwise.

Usage

Exemples

Extraits de code prêts à coller.

Named and custom validators

typescript