Tell us what’s happening:
it seems to me that there are some issues with the regex compiler on the site my current solution (not as clean as it could be i know) passes all unit tests, but it will not work on code camp.
https://regex101.com/r/AlyWyI/1 - evidence of unit tests passed
Your code so far
function telephoneCheck(str) {
if (str == /^(1\s{0,1}\-{0,1}((\(\d{3}\))|(\d{3}))|((\(\d{3}\))|(\d{3})))\s{0,1}\-{0,1}\d{3}\s{0,1}\-{0,1}\d{4}$/){
return true;
}else{
return false;
}
}
telephoneCheck("555-555-5555");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/validate-us-telephone-numbers