From fc76056fb8f0ec713a3f2a2b6206a3336932c382 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Mon, 20 Mar 2023 08:46:10 +0100 Subject: Cleanup regex for detecting keywords (fixes #709). --- sqlparse/keywords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index f04f928..f85d468 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -86,7 +86,7 @@ SQL_REGEX = [ (r'(NOT\s+)?(REGEXP)\b', tokens.Operator.Comparison), # Check for keywords, also returns tokens.Name if regex matches # but the match isn't a keyword. - (r'[0-9_\w][_$#\w]*', PROCESS_AS_KEYWORD), + (r'\w[$#\w]*', PROCESS_AS_KEYWORD), (r'[;:()\[\],\.]', tokens.Punctuation), (r'[<>=~!]+', tokens.Operator.Comparison), (r'[+/@#%^&|^-]+', tokens.Operator), -- cgit v1.2.1