public bool IsPhone(string input){string pattern = "^\(0\d{2}\)[- ]?\d{8}$|^0\d{2}[- ]?\d{8}$|^\(0\d{3}\)[- ]?\d{7}$|^0\d{3}[- ]?\d{7}$";Regex regex = new Regex(pattern);return regex.IsMatch(input);}
public bool IsPhone(string input){string pattern = "^\(0\d{2}\)[- ]?\d{8}$|^0\d{2}[- ]?\d{8}$|^\(0\d{3}\)[- ]?\d{7}$|^0\d{3}[- ]?\d{7}$";Regex regex = new Regex(pattern);return regex.IsMatch(input);}
转载于:https://www.cnblogs.com/wenjieyatou/p/5469943.html
这个功能就是一般的文本查找功能,比较实用,记录下来,说不定以后可以用到