2009/3/16 Stef Mientki <stef.mien...@gmail.com>: > hello, > > I need to parse a nested list, given as a string, like this > > line = " A [ B [ C+2 ] + 3 ] " > ... > > thanks, > Stef >
Hi, I guess, you can use e.g. pyparsing; there is a "nestedExpr" (and probably other options, I'm not aware of ...:-) Check the example http://pyparsing.wikispaces.com/file/view/nested.py or othere to see, if you can adapt it for your needs. regards vbr -- http://mail.python.org/mailman/listinfo/python-list