Connecting Tech Pros Worldwide Help | Site Map

Re: Python regex question

Tim N. van der Leeuw
Guest
 
Posts: n/a
#1: Aug 15 '08

Hey Gerhard,


Gerhard Häring wrote:
Quote:

Tim van der Leeuw wrote:
Quote:
>Hi,
>
>I'm trying to create a regular expression for matching some particular
>XML strings. I want to extract the contents of a particular XML tag,
>only if it follows one tag, but not follows another tag. Complicating
>this, is that there can be any number of other tags in between. [...]
Sounds like this would be easier to implement using Python's SAX API.

Here's a short example that does something similar to what you want to
achieve:

[...]
I so far forgot to say a "thank you" for the suggestion :-)

The sample code as you sent it doesn't do what I need to do, but I did look
at it for creating SAX handler code that does what I want.

It took me a while to implement, as it didn't fit in the parser-engine I had
and I was close to making a release.

But still: thanks!

--Tim

--
View this message in context: http://www.nabble.com/Python-regex-q...p18997385.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Closed Thread