private static bool IsPhoneNumber(string[] number)
{
bool valid = true;
foreach (string num in number)
{
var status = Regex.Match(num, @"^\+?(\d[\d-. ]+)?(\([\d-. ]+\))?[\d-. ]+\d{5,}$").Success;
valid = valid & status;
}
return valid;
}
Have looked at this method of validating numbers.
I would suggest use libphonenumber-csharp to enable Parsing/formatting/validating phone numbers for all countries.
It has nice goodies backed right in.
Test it here
Have looked at this method of validating numbers. I would suggest use libphonenumber-csharp to enable Parsing/formatting/validating phone numbers for all countries. It has nice goodies backed right in. Test it here