Your parsing code is quite simple as it is, so I don't have strong objections here (but I think it might be somewhat clearer with pyparsing instead of using regular expression...). But just to be clear, what's the difference to ConfigParser's format -- is it about having only one level of sections?