Re: parser question

2005-10-19 Thread Kent Johnson
Micah Elliott wrote: > You might be able to tackle this easily enough with REs if your > structures don't nest arbitrarily. It's hard to tell if this deserves > a formal grammar based on the example. If it does, you could try PLY > (which I've had a pleasant experienc

Re: parser question

2005-10-19 Thread Micah Elliott
On Oct 19, Daniel Sch�le wrote: > I have one format with this structure > > A { > x=1 > y=3 > B { > z = "something here" > } > } > > C { > } > > A { > x=0 > y=0 > B { > z = "other" > } > } > >

Re: parser question

2005-10-19 Thread Daniel Sch
> pattern = re.compile(r"^\s*A\s*{.*}\s*", re.MULTILINE | re.DOTALL) correction pattern = re.compile(r"^\s*A\s*{.*?}\s*", re.MULTILINE | re.DOTALL) I forgot to make it non gready :) -- http://mail.python.org/mailman/listinfo/python-list