Skip to content

Instantly share code, notes, and snippets.

@alexandreservian
Created January 30, 2020 15:41
Show Gist options
  • Save alexandreservian/5704fcee1b7fb9103fb40f732775219e to your computer and use it in GitHub Desktop.
Save alexandreservian/5704fcee1b7fb9103fb40f732775219e to your computer and use it in GitHub Desktop.
Método match
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