判断是否手机号码
//javascript
function isTelOrMobile(telephone) {
var teleReg = /^((0\d{2,3})-)(\d{7,8})$/;
var mobileReg = /^1[3456789]\d{9}$/;
if (!teleReg.test(telephone) && !mobileReg.test(telephone)) {
return false;
} else {
return true;
}
}
//C#
public static bool IsMobilePhone(string input) {
Regex regex = new Regex("^1\\d{10}$");
return regex.IsMatch(input);
}