From 0b655dc28e30f1a0feb8734855b624d2ea144b62 Mon Sep 17 00:00:00 2001 From: qishiyao Date: Thu, 18 Aug 2022 13:40:26 +0800 Subject: [PATCH] fix version semver format --- backend/internal/app/validator/field/regex.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/app/validator/field/regex.go b/backend/internal/app/validator/field/regex.go index 7e7b3536..5816c521 100644 --- a/backend/internal/app/validator/field/regex.go +++ b/backend/internal/app/validator/field/regex.go @@ -7,5 +7,5 @@ package field import "regexp" var ( - versionRegexSemantic = regexp.MustCompile(`^\d+\.\d+\.\d+$`) + versionRegexSemantic = regexp.MustCompile(`^(?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-]+)*))?$`) )