I have this string:
+1(333) 456-7890
I want to match it with a regular expression. This is what I have now for my regex pattern:
Pattern p1 = Pattern.compile("((\\+{0,}[0-9]{0,3}( |-)?)?)(\\(?[0-9]
{3}\\)?|[0-9]{3}( |-)?)([0-9]{3}( |-)?)([0-9]{4}|[a-zA-Z0-9]{7})");
It is supposed to recognize any phone number pattern with potential dashes or spaces in the middle, that could be at least 10 digits (or letters), with no country code and at most 13 digits with a country code.
My pattern seems to match certain cases and not others such as the one previously stated. I'm really stumped, any help would be appreciated.