常用的正则判断(表单验证)
//邮箱
mail = /^[a-z0-9._%-]+@([a-z0-9-]+\.)+[a-z]{2,4}$/;
//电话验证规则
phone = /^0\d{2,3}-\d{7,8}$/;
"电话格式如:0371-68787027");
//无区号电话验证规则
noactel = /^\d{7,8}$/;
//"电话格式如:68787027
//手机验证规则
mobile = /^1[3|4|5|7|8]\d{9}$/;
//邮箱或手机验证规则
/^[a-z0-9._%-]+@([a-z0-9-]+\.)+[a-z]{2,4}$|^1[3|4|5|7|8]\d{9}$/;
//电话或手机验证规则
tm = /(^1[3|4|5|7|8]\d{9}$)|(^\d{3,4}-\d{7,8}$)|(^\d{7,8}$)|(^\d{3,4}-\d{7,8}-\d{1,4}$)|(^\d{7,8}-\d{1,4}$)/;
//年龄
age = /^(?:[1-9][0-9]?|1[01][0-9]|120)$/;
//汉字
chinese = /^[\u4E00-\u9FFF]+$/;
//身份证
isIDCard1 = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/; //(15位)
r isIDCard2 = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/; //(18位)