I have text in the following format:
section name 1:
this text goes into the
first sectionsection name 2:
this text
goes into the second section
etc,
Where section names are arbitrary phrases and section contents will contain free text except section name. I need to split this text into object pairs of type (section name, section text).
Is there an effective RegEx or other recommended way of doing this?
Thanks.
-Raj
Well it depends on the structure of your document. For example, does each section have an empty line? If so, then it will be easy by just scanning line by line and just construct your object that way.
Then your Section might be: