Squash a regex warning

warnings.py:109 - /edx/app/edxapp/edx-platform/common/djangoapps/static_replace/__init__.py:76: DeprecationWarning: Flags not at the start of the expression '\n        (?x)       ' (truncated)
This commit is contained in:
Ned Batchelder
2020-11-16 10:21:49 -05:00
parent 4bc913e497
commit 9a72148310

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