题解 | #合法IP#
合法IP
http://www.nowcoder.com/practice/995b8a548827494699dc38c3e2a54ee9
为什么没人使用正则
```let str;
while(str=readline()){
let flag = "YES";
// ip port reg :
let rr = /^((0)|(1\d{2})|(2[0-4]\d)|(25[0-5])|([1-9]\d?))\.((0)|(1\d{2})|(2[0-4]\d)|(25[0-5])|([1-9]\d?))\.((0)|(1\d{2})|(2[0-4]\d)|(25[0-5])|([1-9]\d?))\.((0)|(1\d{2})|(2[0-4]\d)|(25[0-5])|([1-9]\d?))$/
print(rr.test(str) ? "YES" : "NO")
}