Created
April 4, 2022 21:51
-
-
Save eduardorangell/59d2a9d2a0d4c627adfd65d4f4944446 to your computer and use it in GitHub Desktop.
Regex para formatar CPF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cpf = "1234567890"; | |
console.log(cpf.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, '$1.$2.$3-$4')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment