1.判断不能为小数
var regex=/^\d+\.\d+$/;
if(score<1){
alert("不能小于1")
flag1=true;
}else if(regex.test(score)){
alert("不能为小数")
flag1=true;
}
正则表达式手册:https://tool.oschina.net/uploads/apidocs/jquery/regexp.html
2.验证邮箱的正则表达式
regEmail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/
3.验证手机号的正则表达式
regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/