On Feb 1, 10:54 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> >> Well, if all you want to do is remove everything from a "<" to a
> >> ">", you can use
>
> >>   >>> s = "<B>Today</B> is <U>Friday</U>"
> >>   >>> import re
> >>   >>> r = re.compile('<[^>]*>')
> >>   >>> print r.sub('', s)
> >>   Today is Friday
>
> [Tim's ramblings about pathological cases snipped]

pyparsing includes an example script for stripping tags from HTML
source.  See it on the wiki at 
http://pyparsing.wikispaces.com/space/showimage/htmlStripper.py.

-- Paul
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to