标准的IP地址是192.168.0.1,
能不能通过正则表达式判断,文本框中有4个".",而且"."中都是不大于256的数字?
alert("success");
}else{
alert("error");
}
1\\d\\d2[0-4]\\d2[0-4][0-9]
1\d{0,2}[1-9]\d?)\.(?:(?:25[0-5]2[0-4]\d2[0-4]\dvar ipRegEXP = /^(25[0-5]\d{1,2})\.){2}(25[0-5]2[0-4]\\d
Pattern.compile("\\b((?!\\d\\d\\d)\\d+\d{1,2})/;
ip = textvalue;
if (!ipRegEXP.exec(ip)){
alert("ip格式不对!");
}1\\d\\d1\\d\\d2[0-4]\\d25[0-5])\\.((?!\\d\\d\\d)\\d+2[0-4]\\d1\d{0,2}1\\d\\d25[0-5])\\.((?!\\d\\d\\d)\\d+25[0-5])\\b");
var ip ="192.168.1.111";
if(ip.match(/^(?:(?:25[0-5]2[0-4]\d[01]?[0-9][0-9]?)\.){3}(?:25[0-5]