]> Sergey Matveev's repositories - path-extractor.git/blobdiff - validators.go
Add ip adress regression
[path-extractor.git] / validators.go
index 60a817c9beb239988faf277b377626d0ba467900..df6daf5c5a1f74750050fbd947ba495baef616b2 100644 (file)
@@ -51,6 +51,11 @@ func replaceGitPath(input string) string {
        return string(temp[1])
 }
 
+func isIp(input string) bool {
+       r := regexp.MustCompile("^[0-9]{1,3}\\.[0-9x]{1,3}\\.[0-9x]{1,3}\\.[0-9x]{1,3}$")
+       return r.Match([]byte(input))
+}
+
 func isVersion(input string) bool {
        r := regexp.MustCompile("^v?[0-9x]{1,3}\\.[0-9x]{1,3}(\\.[0-9x]{1,3})?$")
        return r.Match([]byte(input))