Skip to content

Instantly share code, notes, and snippets.

@remibreton
Last active December 17, 2015 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remibreton/5543538 to your computer and use it in GitHub Desktop.
Save remibreton/5543538 to your computer and use it in GitHub Desktop.
/(1)?( |-)?(\()?(\d{3})(\))?( |-)?(\d{3})( |-)?(\d{4})/.test('123 456 7890');
@remibreton
Copy link
Author

Matches:
1234567890
123 456 7890
123-456-7890
1 123 456 7890
1-123 456 8790
1(123) 456 7890
1 (123) 456-7890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment