From b219a85e1280d161fbfa8c51b7bc918ed104bb84 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Sun, 7 May 2023 17:51:35 +1000 Subject: [PATCH] refactor(model): use recommended semver regex (#5403) Signed-off-by: James Elliott --- internal/model/const.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/model/const.go b/internal/model/const.go index 085ef8946..3fc1604f0 100644 --- a/internal/model/const.go +++ b/internal/model/const.go @@ -22,7 +22,7 @@ const ( SecondFactorMethodDuo = "mobile_push" ) -var reSemanticVersion = regexp.MustCompile(`^v?(?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*))?(\+(?P[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*))?$`) +var reSemanticVersion = regexp.MustCompile(`^v?(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?: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[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`) const ( semverRegexpGroupPreRelease = "PreRelease"