Skip to content

Instantly share code, notes, and snippets.

@jnwelzel
Created February 12, 2015 19:04
Show Gist options
  • Save jnwelzel/e0a922cbbb4a517dded5 to your computer and use it in GitHub Desktop.
Save jnwelzel/e0a922cbbb4a517dded5 to your computer and use it in GitHub Desktop.
/^(\(0?\d{2}\)\s?|0?\d{2}[\s.-]?)\d{4,5}[\s.-]?\d{4}$/.test('(47) 9999-9999'); //true
/^(\(0?\d{2}\)\s?|0?\d{2}[\s.-]?)\d{4,5}[\s.-]?\d{4}$/.test('47 9999 9999'); //true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment