Test, validate and match regular expressions
Validates Spanish national identity documents including DNI (8 digits + letter) and NIE (starts with X/Y/Z, 7 digits + letter). The optional leading X, Y, or Z distinguishes foreign residents, while the final letter serves as a verification character. Commonly used in forms requiring Spanish identity verification for banking, government services, or age validation.