求一个判断IP地址有效性的正则表达式
在线等
------解决方案--------------------验证有效性 ^(\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])\.(\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])$
参考http://www.cnblogs.com/HeroBeast/archive/2009/03/12/1409443.html
解析IP地址正则表达式:((?:(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d?\d))
参考 http://school104.iteye.com/blog/1027940
------解决方案--------------------JScript code
var str=$("#mps").val();
var ss = str.split(",");
var partten = /^((\(\d{2,3}\))|(\d{3}\-))?(1[3458]\d{9})$/;
if(partten.test(ss[i])&&ss.length > 0){
$(":button").removeAttr("disabled");
}else{
alert("请用逗号隔开输入正确手机号码!");
$(":button").attr("disabled", "true");
return false ;
}
------解决方案--------------------
上面原来我是验证输入多条手机号码 的