func isIp(address string) bool {
    ip := net.ParseIP(address)
    if ip != nil {
        return true
    }
    return false
}
func isIp1(address string) bool {
    ipReg := `^((0|[1-9]\d?|1\d\d|2[0-4]\d|25[0-5])\.){3}(0|[1-9]\d?|1\d\d|2[0-4]\d|25[0-5])$`
    r, _ := regexp.Compile(ipReg)
    match := r.MatchString(address)
    if match {
        return true
    }
    return false
}

发表回复

您的电子邮箱地址不会被公开。

Captcha Code