function telephoneCheck(str) {
// regular expression making up
var reg = /^(1\s?)?(\(\d{3}\)|\d{3})[\-\s]?\d{3}[\-\s]?\d{4}$/;
return reg.test(str);
}
//test case
telephoneCheck("555-555-5555");
/* check for more
555-555-5555
(555)555-5555
(555) 555-5555
555 555 5555
5555555555
1 555 555 5555
*/