正则校验
/*校验手机号码*/
function isValidPhone(mobile){
// var re = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|19[0-9]|14[57])[0-9]{8}$/;
var re =/^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/;
return re.test(mobile);
}
/* 校验固话*/
function istel(mobile){
var tel =/^(400|800)([0-9\\-]{7,10})|(([0-9]{4}|[0-9]{3})(-| )?)?([0-9]{7,8})((-| |转)*([0-9]{1,4}))?$/;
return tel.test(mobile);
}
/* 校验身份证号 */
function checkICCard(resumeIdCard) {
var idCard =/^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/;
return idCard.test(resumeIdCard);
}
/* 判断字符串是否为空 */
function isNotBlank(variable) {
if (variable ==null || variable ==undefined || variable =='' || variable.trim() =='' || variable.toLocaleLowerCase().trim() =='null') {
return false;
}
return true;
}
/* 校验网络地址 */
function isValidWebSite(website) {
//var regExp = new RegExp('(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
var regExp =/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/;
if(website!="" && !regExp.test(website)){
return false;
}
return true;
}