MCPcopy Create free account
hub / github.com/celer-pkg/celer / isValidVersionFormat

Method isValidVersionFormat

generator/generator.go:128–135  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

126}
127
128func (t *targetConfig) isValidVersionFormat(version string) bool {
129 // Match patterns:
130 // 1. ^\d+(\.\d+)*$ -- number version (1, 1.2, 1.2.3, 1.2.3.4)
131 // 2. ^\d+(\.\d+)*[-+][a-zA-Z0-9._]+$ -- number version with suffix (1.0.0-alpha1, 2.0+beta)
132 pattern := `^(\d+(\.\d+)*)([-+][a-zA-Z0-9._]+)?$`
133 matched, _ := regexp.MatchString(pattern, version)
134 return matched
135}
136
137// ReadCMakeConfig Find matched cmake config.
138func ReadCMakeConfig(configPath, systemName string) (*targetConfig, error) {

Callers 1

GenerateCMakeListsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected