Merge pull request #25604 from edx/nedbat/squash-regex-warning

Squash a regex warning
This commit is contained in:
Ned Batchelder
2020-11-16 15:01:09 -05:00
committed by GitHub

View File

@@ -23,8 +23,7 @@ def _url_replace_regex(prefix):
To anyone contemplating making this more complicated:
http://xkcd.com/1171/
"""
return u"""
(?x) # flags=re.VERBOSE
return """(?x) # flags=re.VERBOSE
(?P<quote>\\\\?['"]) # the opening quotes
(?P<prefix>{prefix}) # the prefix
(?P<rest>.*?) # everything else in the url