regex for balanced parentheses?

Paul McGuire ptmcg at austin.rr.com
Thu Jun 12 11:24:11 EDT 2008


Parsing TeX is definitely not for the faint-of-heart!  You might try
something like QuotedString('$', escQuote='$$') in pyparsing.  (I've
not poked at TeX or its ilk since the mid-80's so my TeXpertise is
long rusted away.)

I know of two projects that have taken on the problem using pyparsing
- one is the mathtext module in John Hunter's matplotlib, and Tim
Arnold posted some questions on the subject a while back - try
googling for "pyparsing tex" for further leads.

-- Paul



More information about the Python-list mailing list