[Tutor] Another regular expression question

Bernard Lebel 3dbernard at gmail.com
Wed Sep 14 15:08:36 CEST 2005

Thanks Alan,

I'll check BeautifulSoup asap.

I'm using regex simply because I have no clue where to start to parse
XML. I have read the various xml tools available in the Python
library, however I'm a complete loss at what to make out of them. Many
of them seem to use some programming standards, wich I am completely
unfamiliar with (this is the first time that I dig into XML writing
and parsing).

I don't know where to start to learn about all these standards, and as
usual with new programming things, the documentation is hard to
swallow (it usually is written more as a reference than a proper user
guide/tutorial). I have to admit this is very frustrating, so if I'm
looking at things from a wrong perspective please advise me, I need

So right now I'm just taking a shortcut and using ultra-simple
re-based parser to retrieve the tags I'm looking for. I know it will
probably be slow, but hopefully I'll get familiar with sophisticated
parsing in the future and improve my code. As it stands right now,
even the re syntax is not super easy to learn.

Kent: That works (of course!). Thanks a bunch once again!


On 9/14/05, Alan G <alan.gauld at freenet.co.uk> wrote:
> Hi Bernard,
> > Hello, yet another regular expression question :-)
> >
> > So I have this xml file that I'm trying to find a
> > specific tag in.
> I'm always suspicious when I see regular expression
> and xml/html in the same context. regex are not good
> for parsing xml/html files and it's usually much easier
> to use a proper parser - such as beautiful soup.
> http://www.crummy.com/software/BeautifulSoup/
> Is there any special reason why you are using a regex
> sledgehammer to crack this particular nut? Or is it
> just to gain experience using regex?
> Alan G.

More information about the Tutor mailing list