Skip to content

Instantly share code, notes, and snippets.

@alexandreservian
Created January 30, 2020 15:33
Show Gist options
  • Save alexandreservian/fc5d5adf5674638c17df8c004417d7ba to your computer and use it in GitHub Desktop.
Save alexandreservian/fc5d5adf5674638c17df8c004417d7ba to your computer and use it in GitHub Desktop.
Método test
const regex = /(\((\d{2})\)\s?)?(\d{4,5})[-]?(\d{4})/gm;
console.log(regex.test('(77) 95684-9783')); //true
console.log(regex.test('(68)90499-9922')); //false
console.log(regex.test('95088-2649')); //true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment