Stripping HTML with RE

Miles Fender miles_f at
Wed Nov 10 00:20:29 CET 2004

Steveo wrote:
> I am currently stripping HTML from a string with the following code. 
> (I know it's not the best way to strip HTML but bear with me)
 > [...]

Instead of using REs, you might consider the StrippingParser
from the Python Cookbook:

It allows you to specify explicitly which tags you want to leave
intact, so you'll be able to change your mind later without futzing
about with a complex RE...


More information about the Python-list mailing list