标签:
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‘]
>>>
nest expression & Pyparsing
标签:
原文地址:http://www.cnblogs.com/yxwkf/p/5156523.html