Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make version expression public #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions version.go
Expand Up @@ -38,8 +38,8 @@ var (
ErrInvalidPrerelease = errors.New("Invalid Prerelease string")
)

// semVerRegex is the regular expression used to parse a semantic version.
const semVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` +
// VersionExpression is the regular expression used to parse a semantic version.
const VersionExpression string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` +
`(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` +
`(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?`

Expand All @@ -52,7 +52,7 @@ type Version struct {
}

func init() {
versionRegex = regexp.MustCompile("^" + semVerRegex + "$")
versionRegex = regexp.MustCompile("^" + VersionExpression + "$")
}

const num string = "0123456789"
Expand Down