regex - Regular Expression to Match North American Phone Numbers Not Working -
^(\(\d{3}\)|^\d{3}[.-]?)?\d{3}[.-]?\d{4}$
the above regular expression
have created matching north-american phone number , without parenthesis in code. not working, don't seem find issue.
(180)-555-5555 --> not matching 180-555-5555 --> matching
some 1 me understand why not matching? '\(\d{3}\)'
used capture parenthesis.
Comments
Post a Comment