I am trying to create a regex
that only accepts 2 types of phone number inputs. The phone number inputs are (5554446666) and (+15554446666) and nothing else, so this is the regex
I wrote:
Regex phoneNumberPattern = new Regex(@"^\s*(?:\+?(\d{1,3}))?(\d{7})");
The problem is when I entered just seven digits (4446666), it accepted it.