From 527e5c047afef98191ee5a8120c00faffcfa9ef5 Mon Sep 17 00:00:00 2001 From: Edgar HIPP Date: Sat, 16 Jan 2016 08:36:29 +0100 Subject: [PATCH] Correct version number --- pe_test.go | 5 +++++ validators.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pe_test.go b/pe_test.go index 677161c..bc07d27 100644 --- a/pe_test.go +++ b/pe_test.go @@ -132,6 +132,11 @@ func TestEverything(t *testing.T) { 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 38704c7..60a817c 100644 --- a/validators.go +++ b/validators.go @@ -52,7 +52,7 @@ func replaceGitPath(input string) string { } 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)) } -- 2.44.0