refactor(model): use recommended semver regex (#5403)

Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
pull/5404/head^2
James Elliott 2023-05-07 17:51:35 +10:00 committed by GitHub
parent fb5c285c25
commit b219a85e12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const (
SecondFactorMethodDuo = "mobile_push" SecondFactorMethodDuo = "mobile_push"
) )
var reSemanticVersion = regexp.MustCompile(`^v?(?P<Major>\d+)\.(?P<Minor>\d+)\.(?P<Patch>\d+)(\-(?P<PreRelease>[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*))?(\+(?P<Metadata>[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*))?$`) var reSemanticVersion = regexp.MustCompile(`^v?(?P<Major>0|[1-9]\d*)\.(?P<Minor>0|[1-9]\d*)\.(?P<Patch>0|[1-9]\d*)(?:-(?P<PreRelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<Metadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`)
const ( const (
semverRegexpGroupPreRelease = "PreRelease" semverRegexpGroupPreRelease = "PreRelease"