mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #32499 -- Escaped additional metacharacters in simplify_regex().
This commit is contained in:
committed by
Mariusz Felisiak
parent
85540da930
commit
448d974d96
@@ -145,7 +145,7 @@ unnamed_group_matcher = _lazy_re_compile(r'\(')
|
||||
def replace_metacharacters(pattern):
|
||||
"""Remove unescaped metacharacters from the pattern."""
|
||||
return re.sub(
|
||||
r'((?:^|(?<!\\))(?:\\\\)*)(\\?)([?^$])',
|
||||
r'((?:^|(?<!\\))(?:\\\\)*)(\\?)([?*+^$]|\\[bBAZ])',
|
||||
lambda m: m[1] + m[3] if m[2] else m[1],
|
||||
pattern,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user