Hi,
I have been trying to solve - https://www.freecodecamp.org/challenges/validate-us-telephone-numbers
Now i have read and searched but could not find any regex where i can check if there is any opening bracket then only there can be a closing bracket, i have been stuck on this point for some time now , can any one guide me here … thanks …below is my code -
function telephoneCheck(str) {
var test1 = /\d?\s?\(?\d{3}\-?\)?\s?\d{3}?-?\s?\d{4}/;
return test1.test(str);
}
telephoneCheck("1 555)555-5555");