当前位置:编程学习 > JAVA >>

判断IP的正则表达式

print?var reg = /^(\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])$/; 
           if (!reg.test(RestrictIp)) { 
               $("#RestrictIp").focus(); 
               alert("请输入正确的IP地址!"); 
               return false; 
           } 
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,