From 0972b439e23d78042398dd2dcdbad16fc985c213 Mon Sep 17 00:00:00 2001 From: Bruno Calza Date: Wed, 18 Jan 2023 18:18:27 -0300 Subject: [PATCH] adds missing caret to regex Signed-off-by: Bruno Calza --- pkg/parsing/impl/validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parsing/impl/validator.go b/pkg/parsing/impl/validator.go index 128ff754..a329cd32 100644 --- a/pkg/parsing/impl/validator.go +++ b/pkg/parsing/impl/validator.go @@ -32,7 +32,7 @@ func New(systemTablePrefixes []string, opts ...parsing.Option) (parsing.SQLValid } } - tablePrefixRegex := "([A-Za-z]+[A-Za-z0-9_]*)" + tablePrefixRegex := "^([A-Za-z]+[A-Za-z0-9_]*)" queryTableNameRegEx, _ := regexp.Compile(fmt.Sprintf("%s*_[0-9]+_[0-9]+$", tablePrefixRegex)) createTableNameRegEx, _ := regexp.Compile(fmt.Sprintf("%s*_[0-9]+$", tablePrefixRegex))