pe_test.go | 5 +++++ validators.go | 2 +- diff --git a/pe_test.go b/pe_test.go index 677161c4f6f6b322d0a574dde7eef37888631276..bc07d279b695c12fb8f8c33e1cd2cc7f6efde3be 100644 --- a/pe_test.go +++ b/pe_test.go @@ -132,6 +132,11 @@ if len(output) != 0 { 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) diff --git a/validators.go b/validators.go index 38704c79ee284d5e5239afde882fab9d0823778b..60a817c9beb239988faf277b377626d0ba467900 100644 --- a/validators.go +++ b/validators.go @@ -52,7 +52,7 @@ return string(temp[1]) } 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)) }