Clean "Durty" strings

Michael Hoffman cam.ac.uk at mh391.invalid
Mon Apr 2 21:08:40 CEST 2007


irstas at gmail.com wrote:

> But it could be that he just wants all HTML tags to disappear, like in
> his example. A code like this might be sufficient then: re.sub(r'<[^>]
> +>', '', s).

Won't work for, say, this:

<img src="src" alt="<text>">
-- 
Michael Hoffman



More information about the Python-list mailing list