Parsing nested constructs

tool69 kib2 at free.fr
Sat Sep 8 16:42:06 EDT 2007


Hi,

I need to parse some source with nested parenthesis, like this :

 >cut-------------

{
     {item1}
     {
      {item2}
      {item3}
     }
}

 >cut-------------


In fact I'd like to get all start indexes of items and their end (or 
lenght).

I know regexps are rather limited for this type of problems.
I don't need an external module.

What would you suggest me ?

Thanks.



More information about the Python-list mailing list