Skip to content

Instantly share code, notes, and snippets.

@oskarnrk
Forked from massic80/isvalidfiscalcode.js
Last active April 29, 2021 06:43
Show Gist options
  • Save oskarnrk/da0f90c6602f8c936f306f64bd7a2ea4 to your computer and use it in GitHub Desktop.
Save oskarnrk/da0f90c6602f8c936f306f64bd7a2ea4 to your computer and use it in GitHub Desktop.
Check Italian Fiscal Code
const validFiscalCodeRegexp = /^([A-Za-z]{6}[\dlmnpqrstuvLMNPQRSTUV]{2}[abcdehlmprstABCDEHLMPRST]{1}[\dlmnpqrstuvLMNPQRSTUV]{2}[A-Za-z]{1}[\dlmnpqrstuvLMNPQRSTUV]{3}[A-Za-z]{1})$|(\d{11})$/;
const isValidFiscalCode = cf => validFiscalCodeRegexp.test(cf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment