Reg Exp: Need advice concerning "greediness"

Franz GEIGER fgeiger at datec.at
Tue Oct 3 13:01:06 EDT 2000


Thanks, that clarified the use of htmllib (at least I think so). Great
module if one wants to extract certain information out from an HTML file!

As I played around I saw, that it does not fully fit my needs: I do not want
to extract information, I do want to change or insert information. If I got
everything right, I would have to define methods for EVERY tag occurring in
the HTML file, because otherwise the parser would omit information.

Or is there a way to let HTMPParser write the unextracted data into a buffer
for displaying them?

I want to change certain parts of HTML files e.g. font tags. All other parts
should remain unchanged. After having done my changes I'd like to save the
unchanged parts and the changed parts into a file for publishing on a
server.

Do I have to stick with regexp?

Or is it a good idea to write my own parser, taking idea and concept from
HTMLParser (really good idea to call hooks on the occurrence of certain
tags)?

Many thanks
and best regards
Franz GEIGER



Alex <the_brain at mit.edu> schrieb in im Newsbeitrag:
etdn1gosdag.fsf at w20-575-36.mit.edu...
>
> > Sounds promising. It's a Python std module, isn't it? Yet I could not
> > find sample scripts showing me how to use it? Any idea how to begin
> > with?
>
> Yeah, the docs for it are a bit hard to figure out.  Here's some sample
> code from Alex Martelli.
>
> http://www.python.org/pipermail/python-list/2000-August/114566.html
>
> Alex.
>
> --
> Speak softly but carry a big carrot.
>





More information about the Python-list mailing list