Skip to content

Instantly share code, notes, and snippets.

@blooski
Last active December 22, 2015 01:59
Show Gist options
  • Save blooski/6400477 to your computer and use it in GitHub Desktop.
Save blooski/6400477 to your computer and use it in GitHub Desktop.
Validate Phone Number - multiple formats regex
function validatePhone(phone) {
var reg = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\s\.]{0,1}[0-9]{3}[-\s\.]{0,1}[0-9]{4}$/;
return reg.test(phone);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment