I have some ASCII documents in the following format:
[section heading]
paragraphs......
[section heading]
paragraphs......
...
Note: heading text are always enclosed in some specific pattern (e.g.
[]in the above example)
I want to split the file into separate sections (each with a heading and the content).
What would be the most efficient way to parse the above document?
Using Regex.Match() I can extract the headings, but not the subsequent text content.
Using Regex.Split() I can grab the content, but not the related headings.
Is it possible combine these two Regex methods to parse the document? Are there better ways to achieve the same?