github.com/azunymous/cdx@v0.0.0-20201122180449-fbb46cc4d252/parse/version.go (about) 1 package parse 2 3 import "regexp" 4 5 var version = regexp.MustCompile(`[0-9]+\.[0-9]+\.[0-9]+`) 6 7 // Version returns the semantic version (X.Y.Z) from a tag, returning an empty string if not found. 8 func Version(tag string) string { 9 return version.FindString(tag) 10 }