If I have an xml tag, such as:
<tag>
... abunch of stuff inside here
</tag>
How would I remove everything inside , inclusive of the tags itself?
I tried re.sub('<tag>.+</tag>', '', string) but it wasn’t working. What am I doing wrong here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could do it safely? with
lxmlwhich goes against your desire torebut you might have been persuaded by other’s comments that usingreis fraught with danger.Gives: