I want to create regular expression to validate US phone numbers, which will validate below need:
333 (till 1 to 3 digits)
333-3 (3 digits + 1 hyphen + 1 to 3 digit)
333-333-3333 (3 digits + 1 hyphen + 3 digit + 1 hyphen + 1 to 4 digits)
333-333-3333 3333 (3 digits + 1 hyphen + 3 digit + 1 hyphen + 4 digits + 1 space + 1 to 4 digits)
33333333333333 (any number of digit between 1 to 14)
I started regular expression from:
^\d{0-3}-\d{3}-\d{4}\s\d{4}$
Here I only want to validate above conditions, No special characters are allowed. I don't want to be generic. Only need to follow above conditions. Thanks in advance.