I need to remove all tags from HTML files. matchstr = re.compile(r'''<.*?>''',re.DOTALL|re.MULTILINE) print matchstr.sub(" ", str ) The program works well for tags located on one line, but dosn't delete tags if the brackets <> are on different lines, like <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000} --> What is wrong? Irina Szabo