I have a string that I need to remove the characters in the string between two other strings.
At the moment I have the following code, I'm not too sure why it doesn't work.
def removeYoutube(itemDescription):
itemDescription = re.sub('<iframe>.*</iframe>','',desc,flags=re.DOTALL)
return itemDescription
It doesn't remove the string in between and including and .
Example Input (String):
"<div style="text-align: center;"><iframe allowfullscreen="frameborder=0" height="350" src="https://www.youtube.com/embed/EKaUJExxmEA" width="650"></iframe></div>"
Expected Output: <div style="text-align: center;"></div>
As you can see from the output it should remove all of the parts containing <iframe></iframe>
.