HTML Parser

Kragen Sitaker kragen at dnaco.net
Sat Dec 30 20:48:44 EST 2000


In article <mailman.978224102.28797.python-list at python.org>,
Voitenko, Denis <dvoitenko at qode.com> wrote:
>HTMLtags=re.compile('<.*>')

In a string like "x<a>b<c>d", this will match "<a>b<c>", because the .*
matches "a>b<c".  This explains your problem.

Fixing it is harder.
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we possess
ourselves.
       -- Gandalf the White [J.R.R. Tolkien, "The Two Towers", Bk 3, Ch. XI]





More information about the Python-list mailing list