On 06.10.2006 03:28, Logan Capaldo wrote:
> I would write a grammar and a recursive descent parser for files like
> these. Someone is bound to reply with some crazy regexp that works, but
> only they will ever understand it ;).

:-))  Basically it depends on how much nesting of brackets is allowed. 
If there is indefinite nesting, then yes, a proper parser is the best 
solution.  If it is just two levels as shown in the example a regexp is 
not too hard (to write and understand) IMHO.

Kind regards

	robert