Regional formats
Common regional formats built with bind(). These masks format input; “complete” means the expected character count is present, not that a checksum or identifier is valid — the date masks below never check that a month or day exists.
US — Phone
index.ts
bind(input, '(999) 999-9999')US — SSN
index.ts
bind(input, '999-99-9999')US — ZIP+4
index.ts
bind(input, '99999-9999')US — date (M/D/YYYY)
index.ts
bind(input, '9{1,2}/9{1,2}/9{4}')ISO 8601 — date, unpadded
index.ts
bind(input, '9{4}-9{1,2}-9{1,2}')Canada — postal code
index.ts
bind(input, 'Z9Z 9Z9', { tokens: { Z: { match: /[a-z]/i, transform: char => char.toUpperCase() } } })Canada — SIN
index.ts
bind(input, '999 999 999')Germany — IBAN
index.ts
bind(input, 'DE99 9999 9999 9999 9999 99')Germany — VAT ID
index.ts
bind(input, 'DE999999999')Poland — postal code
index.ts
bind(input, '99-999')