I have raw HTML and am trying to remove this whole block like this [%~ as..abcd ~%] from the output string. Using re library of python
teststring = "Check the direction . [%~ MACRO wdwDate(date) BLOCK;
SET tmpdate = date.clone();
END ~%] Determine if both directions."
cleanM = re.compile('\[\%\~ .*? \~\%\]')
scleantext = re.sub(cleanM,'', teststring)
what is wrong in the code ?