From 9b9c805cedb08621bd5dc58a01a6478eb7cc49a9 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 2 Aug 2023 19:53:16 +0200 Subject: Removed unneeded escapes in regexes. Special characters lose their special meaning inside sets of characters. "-" lose its special meaning if it's placed as the first or last character. Follow up to 7c6b66383da5f9a67142334cd2ed2d769739e8f1. --- django/db/models/sql/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/models/sql/query.py') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 220ae92754..9853919482 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -52,7 +52,7 @@ FORBIDDEN_ALIAS_PATTERN = _lazy_re_compile(r"['`\"\]\[;\s]|--|/\*|\*/") # Inspired from # https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS -EXPLAIN_OPTIONS_PATTERN = _lazy_re_compile(r"[\w\-]+") +EXPLAIN_OPTIONS_PATTERN = _lazy_re_compile(r"[\w-]+") def get_field_names_from_opts(opts): -- cgit v1.3