From 9d2cb6fc950386e9e59f29faf0d3742c4b12572c Mon Sep 17 00:00:00 2001 From: JavierPan Date: Wed, 10 Nov 2021 12:48:18 +0800 Subject: Add regex pattern to identify REGEXP as a Compasion token --- sqlparse/keywords.py | 1 + 1 file changed, 1 insertion(+) (limited to 'sqlparse') diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index 88631bb..29f27af 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -90,6 +90,7 @@ SQL_REGEX = { tokens.Keyword), (r"(AT|WITH')\s+TIME\s+ZONE\s+'[^']+'", tokens.Keyword.TZCast), (r'(NOT\s+)?(LIKE|ILIKE|RLIKE)\b', tokens.Operator.Comparison), + (r'(NOT\s+)?(REGEXP)\b', tokens.Operator.Comparison), (r'[0-9_A-ZÀ-Ü][_$#\w]*', is_keyword), (r'[;:()\[\],\.]', tokens.Punctuation), (r'[<>=~!]+', tokens.Operator.Comparison), -- cgit v1.2.1