Skip to content

Instantly share code, notes, and snippets.

@AlbertoMonteiro
Created July 29, 2014 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlbertoMonteiro/f2ecfafbbe590994b0ae to your computer and use it in GitHub Desktop.
Save AlbertoMonteiro/f2ecfafbbe590994b0ae to your computer and use it in GitHub Desktop.
Regex com expressão ternária que avalia se string é cpf ou cnpj formatado
^(?([\d.-]{11})(\d{3}\.){2}\d{3}-\d{2}|\d{2}(\.\d{3}){2}/\d{4}-\d{2})$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment