开发环境(蓝色粗体字为特别注意内容)
1,开发语言:JavaScript。
2,参考文献:https://blog.csdn.net/u014594922/article/details/53018351
JavaScript验证IP地址和端口的正则表达式,拿走不谢~~~
var ip="192.168.2.1:8080" var pattIp=/^(\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])\:([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5])$/; if(pattIp.test(ip)==false) { return false; }