この形式のテキスト ファイルを貼り付ける必要があります。
[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]
各セクションには、1 つの開始タグと 1 つの終了タグがあります。セクションはネストできますが、インターリーブはできません。ファイルが大きく、メモリ全体を読み取ることができない可能性があります。
質問: そのようなファイルを解析する最も簡単な方法は何ですか (使用するオープン ソース ライブラリ)?