Lindrian

Untitled

Oct 17th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. input = "test<a href=\"\">a</a>asd asd"
  2. r = re.compile(r"(.+)")
  3. SUB_TAG = Markup(u'<span>{0}</span>')
  4. subst = "\\1"
  5. output = re.sub(r, SUB_TAG.format(subst), regexText)
  6.  
  7. #expected output is <span> with everything inside escaped
Advertisement
Add Comment
Please, Sign In to add comment