I have an html-file that has some sections that need to be removed. All section will be removed except one. I was able to give you a small example, however it is pretty weird that a regex editor recognizes the section.
I want to remove everything between <!--
and -->
, but it doesn't work.
test = '<br/><br/> </span> <!--TABLE<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style=\'border-collapse:collapse;border:none\'> <tr style=\'height:12.95pt\'> <td width=225 valign=top style=\'width:109.45pt;border:solid windowtext 1.0pt;padding:2.4pt 5.4pt 2.4pt 5.4pt;height:12.95pt\'> <span style=\'font-family:"Arial",sans-serif\'> <b>Kontosaldo in \x80</b> </span> </td> </tr> <tr style=\'height:12.95pt\'> <td width=146 valign=top style=\'width:109.45pt;border:solid windowtext 1.0pt;padding:2.4pt 5.4pt 2.4pt 5.4pt;height:12.95pt\'> <span style=\'font-family:"Arial",sans-serif\'> [substringR] </span> </td> </tr> </table>TABLE-->'
r = re.compile(r"(?<=<!--)([\s\n.<>\]\[\\=;,€\/\-\'\":\w\n]+)(?=-->)")
mystring = r.sub('', test)