In this case it's returning true but I need it to return false. I tried adding [()]{0,1} but I think it's only referring to just one"(or)" is there a way I can do [(&)]{0,1} so that "(" and ")" both have to happen at least once. Thank you
function telephoneCheck(str) {
const regex = /^[1]{0,1}[-\s]?[(]?\d{3}[-)\s]?[\s]?[\d]{3}[-\s]?[\d]{4}$/g
return regex.test(str)
}
console.log(telephoneCheck("1 555)555-5555"));