diff options
author | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-14 22:08:28 -0400 |
---|---|---|
committer | Gaurav Jain <gaurav@gauravjain.org> | 2014-05-14 22:08:28 -0400 |
commit | 745f1e190950d2510aecc33de9f1727e24ddddf0 (patch) | |
tree | cf23557213ee9ab7b6cae7cfb30b54f92bdf9fc6 /pygments/lexers/sql.py | |
parent | 41dc0d839cbee3a6bde8511d6fe246503b605c66 (diff) | |
download | pygments-745f1e190950d2510aecc33de9f1727e24ddddf0.tar.gz |
Replace all occurences of [a-zA-Z0-9_] with \w
Diffstat (limited to 'pygments/lexers/sql.py')
-rw-r--r-- | pygments/lexers/sql.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pygments/lexers/sql.py b/pygments/lexers/sql.py index 9a3dcb8d..53df0f75 100644 --- a/pygments/lexers/sql.py +++ b/pygments/lexers/sql.py @@ -150,7 +150,7 @@ class PostgresLexer(PostgresBase, RegexLexer): (r"(E|U&)?'(''|[^'])*'", String.Single), (r'(U&)?"(""|[^"])*"', String.Name), # quoted identifier (r'(?s)(\$[^\$]*\$)(.*?)(\1)', language_callback), - (r'[a-zA-Z_][a-zA-Z0-9_]*', Name), + (r'[a-zA-Z_]\w*', Name), # psql variable in SQL (r""":(['"]?)[a-z][a-z0-9_]*\b\1""", Name.Variable), @@ -435,7 +435,7 @@ class SqlLexer(RegexLexer): # TODO: Backslash escapes? (r"'(''|[^'])*'", String.Single), (r'"(""|[^"])*"', String.Symbol), # not a real string literal in ANSI SQL - (r'[a-zA-Z_][a-zA-Z0-9_]*', Name), + (r'[a-zA-Z_]\w*', Name), (r'[;:()\[\],\.]', Punctuation) ], 'multiline-comments': [ @@ -506,9 +506,9 @@ class MySqlLexer(RegexLexer): # TODO: this list is not complete (r'\b(auto_increment|engine|charset|tables)\b', Keyword.Pseudo), (r'(true|false|null)', Name.Constant), - (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\()', + (r'([a-zA-Z_]\w*)(\s*)(\()', bygroups(Name.Function, Text, Punctuation)), - (r'[a-zA-Z_][a-zA-Z0-9_]*', Name), + (r'[a-zA-Z_]\w*', Name), (r'@[A-Za-z0-9]*[._]*[A-Za-z0-9]*', Name.Variable), (r'[;:()\[\],\.]', Punctuation) ], |