]> Sergey Matveev's repositories - path-extractor.git/blobdiff - validators.go
Tests workability
[path-extractor.git] / validators.go
index 38704c79ee284d5e5239afde882fab9d0823778b..df6daf5c5a1f74750050fbd947ba495baef616b2 100644 (file)
@@ -51,8 +51,13 @@ 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]\\.[0-9x]{1,2}(\\.[0-9x]{1,3})?$")
+       r := regexp.MustCompile("^v?[0-9x]{1,3}\\.[0-9x]{1,3}(\\.[0-9x]{1,3})?$")
        return r.Match([]byte(input))
 }