public static bool ValidatePhoneNumber(string number)
{
return Regex.Match(number, \"^(\\+44\\s?7\\d{3}|\\(?07\\d{3}\\)?)\\s?\\d{3}\\s?\\d{3}$\", RegexOptions.Ignore
Try this code,
using System.Text.RegularExpressions;
public static bool CheckNumber(string strPhoneNumber)
{
string MatchNumberPattern = "^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$";
if (strPhoneNumber != null)
{
return Regex.IsMatch(strPhoneNumber, MatchNumberPattern);
}
else
{
return false;
}
}
Hope, this code helps you.