Regular expressions trouble

Alex cut_me_out at hotmail.com
Mon Jun 5 11:43:39 EDT 2000


> I'm fairly new to the use of regular expressions, and I've come upon a
> problem I can't seem to fix. I'm trying to extract a keyword from a
> HTML-page and color it red. This works fine, except that it also
> extracts the keywords within tags.

Although with some effort you might be able to get them to work in this
case, regular expressions by themselves don't really cut it for that
sort of thing, in my opinion.  You might want to check out htmllib, and
parse the html properly.  If you do, have a look at htmllib.py to get an
idea of how to use it.  I found the library reference suffered from lack
of examples.

Alex.



More information about the Python-list mailing list