验证用户邮箱:
var z=/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(!z.test(user_email)){
$("#user_email_error").html("用户邮箱格式不正确");
return false;
}
验证ip地址:
var zz=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
if(!zz.test(ip)){
art.dialog.alert('IP段不合法!',function () {});
return false;
}
验证ip段地址:
var zz=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\/([0-9]|1[0-9]|2[0-9]|3[0-2])$/;
if(!zz.test(ip)){ art.dialog.alert('IP段不合法!',function () {}); return false; }
原文链接:https://www.f2er.com/regex/362108.html