from HTMLParser import HTMLParser import re r = re.compile('(.*?)', re.DOTALL) htmlstring = """somestrong containing html""" title = r.findall(htmlstring) title = HTMLParser().replace(title)