def _url_replace_regex(prefix):
 return u'\n        (?x)                      # flags=re.VERBOSE\n        (?P<quote>\\\\?[\'"])        # the opening quotes\n        (?P<prefix>{prefix})      # the prefix\n        (?P<rest>.*?)             # everything else in the url\n        (?P=quote)                # the first matching closing quote\n        '.format(prefix=prefix)

def _url_replace_regex ( prefix ) : return u'\n        (?x)                      # flags=re.VERBOSE\n        (?P<quote>\\\\?[\'"])        # the opening quotes\n        (?P<prefix>{prefix})      # the prefix\n        (?P<rest>.*?)             # everything else in the url\n        (?P=quote)                # the first matching closing quote\n        ' . format ( prefix = prefix )
match static urls in quotes that dont end in ?raw .