regular expressions, stack and nesting

Aaron Brady castironpi at
Sun Mar 22 18:38:42 CET 2009

On Mar 22, 12:18 pm, Chris Rebert <c... at> wrote:
> 2009/3/22 Aaron Brady <castiro... at>:
> > Hi,
> > Every so often the group gets a request for parsing an expression.  I
> > think it would be significantly easier to do if regular expressions
> > could modify a stack.  However, since you might nearly as well write
> > Python, maybe there is a compromise.
> If you need to parse something of decent complexity, you ought to use
> a actual proper parser generator, e.g. PLY, pyparsing, ANTLR, etc.
> Abusing regular expressions like that to kludge jury-rigged parsers
> together can only lead to pain when special cases and additional
> grammar complexity emerge and start breaking the parser in difficult
> ways. I'm not seeing the use case for your suggestion.
> Cheers,
> Chris
> --
> I have a blog:

Hey, I don't see the use case either, but that doesn't stop everyone
and their pet snake from asking about it.  </snippity>

I guess I'm looking at something on the scale of a recipe.  Farewell,
dreams and glory.  What do you think anyway?

P.S.  What if the topics were, "kludge jury-rigged parsers"?

More information about the Python-list mailing list