Telephone Number Validator balanced parenthesis

Tell us what’s happening:

I’m almost done with this exercise but I’m not able to figure out how to check for a balanced parenthesis.

Your code so far

function telephoneCheck(str) {
        var s = /^[1]?\s?\(?\d{3}[-.]?\)?\s?\d{3}[-']?\s?\d{4}$/;
        var a = s.test(str);
        return a;


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:

Look into using the or operator along with groups


Is better to do with HTML pattern="" 0-9 and there only can write numbers in a input element.