Created
January 30, 2020 15:41
-
-
Save alexandreservian/5704fcee1b7fb9103fb40f732775219e to your computer and use it in GitHub Desktop.
Método match
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 = ` | |
- 58204-824 | |
- 69337-978 | |
- 69.938-863 | |
- 7287498 | |
`; | |
const regex = /(\d{2}[.]?\d{3})[-]?(\d{3})/gm; | |
console.log(text.match(regex)); | |
// [ '58204-824', '69337-978', '69.938-863'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment