t.Errorf("Matches version number", output)
}
+ output = GetAllMatches("14.22.2", "")
+ if len(output) != 0 {
+ t.Errorf("Matches version number", output)
+ }
+
output = GetAllMatches("~/v1.2/js", "")
if len(output) != 1 {
t.Errorf("Should match path with version inside", output)
}
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))
}