[BangPypers] parsing xml

Kiran Jonnalagadda jace at pobox.com
Mon Aug 1 09:55:40 CEST 2011


On 31-Jul-2011, at 11:33 PM, Venkatraman S wrote:

> A regex is the simplest IMHO, because you need not know the syntax of the
> minidom parser.
> But, again i have seen this quiet often that lack of knowledge of regexp has
> led people to other solutions (the grapes are sour!)

In the eternal words of Jamie Zawinski:

"""
Some people, when confronted with a problem, think 
“I know, I'll use regular expressions.” Now they have two problems.
"""

http://regex.info/blog/2006-09-15/247

Please resist the temptation to use regexps for XML, for down that path lies only pain. It always starts with "oh, only one token? Let me use a regex and get done with it," and soon enough you have a little forest of random-looking characters.

Kiran

-- 
Kiran Jonnalagadda
http://jace.zaiki.in/
http://hasgeek.in/




More information about the BangPypers mailing list