Created
January 30, 2020 16:41
-
-
Save alexandreservian/180c7a25a5443b0d4f1440973f9c1987 to your computer and use it in GitHub Desktop.
Método replace manipulando grupos
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 text = "2019-26-09"; | |
const regex = /(\d{4})-(\d{2})-(\d{2})/g; | |
console.log(text.replace(regex, "$2/$3/$1")); | |
// 26/09/2019 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment