I need to pase a text file in this format:
[section A begin]
some lines
more lines
[section 1 begin]
some lines
[section i begin]
some lines
[section i end]
more lines
[section 1 end]
more lines
[section A end]
[section B end]
...
[section B end]
Each section has 1 begin and 1 end tag; the sections may be nested but may not interleaving; the file may be large and cannot be read in memory as a whole.
Question: what is the easist way to parse such files(any open source libraries to use)?