Re: parse lines to name value pairs

2005-02-27 Thread Paul McGuire
Damned cut-and-paste in GoogleGroups edit window (leading '.'s are to retain spacing): .# get pyparsing at http://pyparsing.sourceforge.net . .from pyparsing import quotedString, printables, Word, OneOrMore, Forward, Literal,delimitedList,Group . .line1 = """path {{data/tom} C:/user/john}""" .line

Re: parse lines to name value pairs

2005-02-27 Thread Paul McGuire
Gee, no takers? Here's a (surprise!) pyparsing solution. -- Paul .# get pyparsing at http://pyparsing.sourceforge.net . .from pyparsing import quotedString, printables, Word, OneOrMore, Forward, Literal,delimitedList,Group .quotedString.setParseAction(lambda s,l,t: t[0].strip("'\"")) . .line1 =