Skip to content

Instantly share code, notes, and snippets.

@pakmans
Forked from gerardorochin/rfc regex
Last active June 27, 2023 15:31
Show Gist options
  • Save pakmans/4627d6bedf37fa7c0951 to your computer and use it in GitHub Desktop.
Save pakmans/4627d6bedf37fa7c0951 to your computer and use it in GitHub Desktop.
Expresion regular para validar RFC
/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/i
/^([A-Z]{4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[HM](AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|NE)[A-Z]{3}[0-9A-Z]\d)$/i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment