I am trying to extract the paragraphs between Result and Conclusion from a research paper using regular expressions. For the following sample, the emphasized paragraphs between "6. Results" and "7. Conclusion" should be matched.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec fermentum orci nec felis. Sed sollicitudin diam id sapien.
6. Results
Ut libero. Vestibulum quam libero, malesuada et, ornare id, aliquet id, tellus.
Nullam dapibus viverra quam. Vestibulum sit amet nunc vel justo dictum pharetra.
7. Conclusion.
Duis imperdiet venenatis purus.
I tried this and it the output is None
x = (re.match(r'^[0-9]\s(Result)\.(.*?)^[0-9]\s(Conclusion)', text))
How could the Python re
module be used to extract the paragraphs? This assumes regexes are the most appropriate tool, but they're not required for answers.