http://pyparsing.wikispaces.com/

http://bbs.csdn.net/topics/330052586

C++ boost

"<([^<>]*?|(?R))*>"

str = "<abcd<asdfasdf<sdfasdf>>sdaf>"

>>> from pyparsing import nestedExpr

>>> data2 = " <a < b <c>>d>"

>>> print nestedExpr("<", ">").parseString(data2).asList()

[['a', ['b', ['c']], 'd']]

>>> print nestedExpr("<", ">").parseString(data2).asList()[0]

['a', ['b', ['c']], 'd']

>>>

05-08 15:14