I want to allow the user to enter only patterns like:
+9720545455454
056565656345
03-43434344
0546-4234234
*9090
+97203-0656534
Meaning, I don't want to allow the user to gibberish everything together, like:
+954-4343+3232*4343+-
+-4343-+5454+9323+234
How can I fixed this pattern
public static bool IsPhoneNumberCorrect(string phoneNumber)
{
return Regex.IsMatch(phoneNumber, @"^[0-9*+-]+$");
}
for that purpose?