Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocs
Identity
es
#nif
#dni
#nie
#spain

Spanish NIF / DNI

Matches a Spanish National Identity Document number (NIF/DNI) — 8 digits followed by a letter, or an NIE starting with X, Y, or Z.

Spanish government formsBank KYCOnline identity verification
/
/
Test String
3 matches
[…]Character class […]Matches any single character listed in this set
0-90-90-9 — range from '0' to '9'
XX'X' — literal character
YY'Y' — literal character
ZZ'Z' — literal character
\d{7}digit\d — digit (0–9) — repeated exactly 7 times · {7} — exactly 7 times
[…]Character class […]Matches any single character listed in this set
A-HA-HA-H — range from 'A' to 'H'
J-NJ-NJ-N — range from 'J' to 'N'
P-TP-TP-T — range from 'P' to 'T'
V-ZV-ZV-Z — range from 'V' to 'Z'
Pattern: 27 charsInput: 29 chars
100% client-side · private

Valid Examples

  • 12345678Z
  • X1234567L
  • Y0000000T

Invalid Examples

  • 1234567Z
  • 123456789Z
  • 12345678I