From 214cdf5c064625d16b7be0f10f031038ca22af93 Mon Sep 17 00:00:00 2001 From: demoManito <1430482733@qq.com> Date: Mon, 18 Mar 2024 14:10:54 +0800 Subject: [PATCH 1/2] chore: optimize regular --- schema/constraint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/constraint.go b/schema/constraint.go index 0ed1eab01..4b0c5316c 100644 --- a/schema/constraint.go +++ b/schema/constraint.go @@ -8,7 +8,7 @@ import ( ) // reg match english letters and midline -var regEnLetterAndMidline = regexp.MustCompile("^[0-9A-Za-z-_]+$") +var regEnLetterAndMidline = regexp.MustCompile(`^\w+$`) type CheckConstraint struct { Name string From c985ecb91aff95cc66d4d5f6ad8f90c8f160a58f Mon Sep 17 00:00:00 2001 From: demoManito <1430482733@qq.com> Date: Mon, 18 Mar 2024 14:16:54 +0800 Subject: [PATCH 2/2] fix --- schema/constraint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/constraint.go b/schema/constraint.go index 4b0c5316c..80a743a83 100644 --- a/schema/constraint.go +++ b/schema/constraint.go @@ -8,7 +8,7 @@ import ( ) // reg match english letters and midline -var regEnLetterAndMidline = regexp.MustCompile(`^\w+$`) +var regEnLetterAndMidline = regexp.MustCompile(`^[\w-]+$`) type CheckConstraint struct { Name string