Remove HTML tags (except anchor tag) from a string using regular expressions

Anand abpillai at gmail.com
Tue Feb 1 08:27:05 EST 2005


I meant
content = re.sub ('<[^!(a>)]([^>]|\n)*[^!(/a)]>', '', content)

Sorry for the mistake.
However this seems to also print tags like <b>, <p> etc
also.

-Anand




More information about the Python-list mailing list