regular expressions questions

Darrell darrell at dorb.com
Wed Mar 29 21:35:09 EST 2000


"Neel Krishnaswami"
> I think that Greg Ewing has the right idea with Plex; strings should
> be for strings, not for encoding a regular expression in. We have a
> perfectly good language -- Python -- for expressing data structures
> in.

Text searching is currently best done with re which is vastly faster than
any Python code. But matching nested structures like <a><a></a></a> can't be
done with re (Unless I missed something). Adding one more bit of syntax to
allow this isn't going scare off new users. In fact I wonder how may times
Tim Petters and others have had to explain that you can't do it?
http://x36.deja.com/getdoc.xp?AN=480818503&CONTEXT=954383165.2025127957&hitn
um=5

http://x36.deja.com/getdoc.xp?AN=478198791&CONTEXT=954383165.2025127957&hitn
um=23

Ok, I could only find two.
But having to learn a parser just to find nested tags is time consuming.
I end up writing a new parser each time. Dumb I know, but parses are kinda
cool.

--Darrell






More information about the Python-list mailing list