• Custom User Avatar

    No. I am just trying to understand why ?[ ] is considered invalid but ? works. I was under the impression [ ] would be matching a space. Just trying to wrap my head around RegEx a bit... I understand that it could still be a cleaner solution after looking at some of the other solutions.

  • Custom User Avatar

    /^\(?\d{3}\)?[ ]\d{3}[-]?\d{4}$/.test("(123)456-7890"); returns false in the dev console. It was returning true for you?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution