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))
+}
+
+func isSpace(input string) bool {
+ r := regexp.MustCompile("^[0-9]*\\.[0-9]+[MGK]$")
return r.Match([]byte(input))
}
}
func containsInvalidString(input string) bool {
- invalidStrings := []string{"//", "()", "and/or", "origin/", "{", "}", "<", ">", "$", "*", "this."}
+ invalidStrings := []string{"//", "()", "and/or", "remotes/", "origin/", "{", "}", "<", ">", "$", "*", "this."}
for _, s := range invalidStrings {
if strings.Contains(input, s) {
return true