Parsing/generating structured text

From: Steven Kurylo <sk_at_no.spam.please>
Date: Wed May 14 2008 - 18:52:13 CST

So I have a structured text file I want to parse and generate ( while
adding new entries as needed).

Last time I did something similar on a loosely structured document I
used perl with regexs to parse the document, tracking state, etc.

I'm going to do this in python and I'm looking at different (better?)
ways, right now I'm reading about pyparsing. Does anyone have other
suggestions?

The text looks something like

config blah boo
    edit 1
        set foo
        set bar
    next
    edit 2
        set foo2
        set bar2
    next
end
Received on Wed May 14 18:52:18 2008

This archive was generated by hypermail 2.1.8 : Wed May 14 2008 - 18:52:20 CST