Changing every other instance of <B> in a file

Lars Klæboe larskl at klassekampen.no
Tue Mar 27 17:44:35 CEST 2001


On Tue, 27 Mar 2001 09:49:39 -0500, Jonathan Soons <jsoons at juilliard.edu>
wrote:
>>>Here's one way (although I'm interested to see how re might do this):
>>
>>[--- interresting code ---]
>>
>>This is another (fancier ;)) implementation of the solution I've
>>been working on, but I still refuse to believe that the script has
>>to be this elaborate/big. *twisting my tired gray matter*
>>
>>I guess re would do the trick (at least if combined with a simple
>>loop, I'll look into it when I'm really awake.
>>
>This seems to fail for tags that do not have a closing tag, which occurs
>frequently in non-automated HTML.

The quark files are checked before they reach my script, and so far
not a single error has occured. Besides the minimal risk, my post check
of the HTML will produce a warning - and even if this check fails,
an error for every umphteenth thousand file is acceptable for this task.

-- 
Lars Klæboe




More information about the Python-list mailing list