I am trying to use regex to grab text from in between sections of a document that have numbered headers. The document has a table of contents and section headers with periods in the numbers for the sections. Ex: 1. Introduction, 1.1 Something, 1.1.1 Something Else I'm able to parse the TOC just fine and get just the section numbers (1.1, 1.1.1, etc.) and am failing in trying to parse the text of the document between those two numbers.
Consider the following (given the document text is just one big string):
1.1 Introduction
There are some sentences in here that I want and I want to do other things with them. There could be hundreds of sentences, who cares.
1.1.1 Something Else
This is where we talk about something else in life.
...
5.1.1 Conclusion
I have tried the following to get the text between 1.1 and 1.1.1 for example and a few variations of such and seem stuck.
(?s)1\.0(.*)1\.1
This works if the only thing in the document is sections 1.0 and 1.1 but since I don't have that luxury.... any help is greatly appreciated.