diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2010-06-17 20:21:44 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2010-06-17 20:21:44 +0200 |
| commit | b737d2093eacf3c34e1eb413192f86f0d8623ecd (patch) | |
| tree | 94a4c346e3e92c0bb05dce06a209fdc249c1a9ee /sqlparse | |
| parent | 521a87c900a19e39f9e508c898cb191acfc75199 (diff) | |
| download | sqlparse-b737d2093eacf3c34e1eb413192f86f0d8623ecd.tar.gz | |
Improve detection of escaped single quotes (fixes issue13, reported by Martin Brochhaus, patch by bluemaro with test case by Dan Carley).
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/lexer.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index a416c16..b7b16af 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -175,8 +175,8 @@ class Lexer: (r'[+/@#%^&|`?^-]+', Operator), (r'[0-9]+', Number.Integer), # TODO: Backslash escapes? - (r"'(''|[^'])*'", String.Single), - (r'"(""|[^"])*"', String.Symbol), # not a real string literal in ANSI SQL + (r"(''|'.*?[^\\]')", String.Single), + (r'(""|".*?[^\\]")', String.Symbol), # not a real string literal in ANSI SQL (r'(LEFT |RIGHT )?(INNER |OUTER )?JOIN\b', Keyword), (r'END( IF| LOOP)?\b', Keyword), (r'CREATE( OR REPLACE)?\b', Keyword.DDL), |
