Here is the problem link:
I’m sure it’s possible to solve this in a one-liner, correct? I tried looking at the hints, but honestly, I don’t understand what I’m supposed to do with the booleans.
This is my regex:
This seems to match correct numbers, but also matches examples like telephoneCheck("(555)5(55?)-5555"). My question is this, is there a way to only match the ‘)’ when there is a ‘(’ three digits earlier?