Reputation: 1768
I am working with a html script converted into a string
How do I replace all the html code in tags with blank using regex?
Upvotes: 16
Views: 14095
Reputation: 26397
Using a relatively simple pattern (for which it might be a good idea to expand on),
import re
html = re.sub(r'<.+?>', '', html)
Upvotes: 22