Skip to content

Commit

Permalink
Cleanup regex for detecting keywords (fixes #709).
Browse files Browse the repository at this point in the history
  • Loading branch information
andialbrecht committed Mar 20, 2023
1 parent 7fdb2da commit fc76056
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqlparse/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
(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),
Expand Down

0 comments on commit fc76056

Please sign in to comment.