I have a very large string. There are many paragraphs inside that string. Each paragraph starts with a title and follows a particular pattern.
Example:
== Title1 == // Paragraph starts
.............
............. // Some texts
.............
End of Paragraph
===Title2 === // Paragraph starts
.............
............. // Some texts
.............
The pattern of the title are:
1.) New Paragraph title starts with an equal to ( = ) and can be followed by any number of =.
2.) After = , there can be a white space ( not necessary though ) and it is followed by text.
3.) After text completion, again there can be a white space ( not necessary ), followed by again any number of equal to's ( = ).
4.) Now the paragraph starts. I have to extract the text until it encounters a similar pattern.
Can anyone help me with how to do this with regex? TIA