searching backwards in a string

John Machin sjmachin at lexicon.net
Wed Feb 13 21:57:55 EST 2002


Jeff Henry <jhenry19 at ford.com> wrote in message news:<3C6AA0C0.CA9FFAA5 at ford.com>...
> John Machin wrote:
> > 
>  [snip]
> > pending bag ... using a regex backwards to find the opening tag is so
> > innovative that I'm totally gobsmacked.
> > 
> I love this group! Yesterday I learned "wackyparse", and today
> "gobsmack"!
> 
> [snip]
> > 
> > Looks like the effbot gets to be gobsmacked too.
> > 
>  Ah, but will he be wackyparsed? Inquiring minds want to know! :)

I would have said, no, not much chance, but look at this, found at the
bottom of a recent effbot post in the place of his normal </F>
signature:

Traceback (most recent call last):
  File "effbot.py", line 105, in ?
  File "SimpleXMLWriter.py", line 103, in end
    assert self.__tags, "unbalanced end(%s)" % tag
AssertionError: unbalanced end(F)

Looks like effbot implemented back-ass-ward regexing for opening HTML
tags already and has been hoist by his (Paul's?) own petard. Can our
hero recover? Will he take the principled approach and insert <F> at
the start of his posts or will he remove the assertion? Tune in
tomorrow for the next exciting episode!



More information about the Python-list mailing list