Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input = "test<a href=\"\">a</a>asd asd"
- r = re.compile(r"(.+)")
- SUB_TAG = Markup(u'<span>{0}</span>')
- subst = "\\1"
- output = re.sub(r, SUB_TAG.format(subst), regexText)
- #expected output is <span> with everything inside escaped
Advertisement
Add Comment
Please, Sign In to add comment