IP地址正则表达式匹配
命令行测试
echo x.x.x.x | egrep "^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])(\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])){3}$"
go
match, _ := regexp.MatchString("^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])(\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[0-9])){3}$", Ip)