Q:

Extract text between two dots, lead by a number

I have basically read the content of a PDF file.  Now, I am trying to figure out the headers.  The consistency is - each header is in the following pattern:
"1.  My Header.  And then the text follows..."
As an example:
x = '1.  Some Header.  and some more text 2.  Another Header.  And that is the end'
import re
re.findall((r'[0-9]\..*\.'),x)

Tried that, but it didn't work out. 
What I was hoping:
Best case: ['1.  Some Header', '2.  Another Header']
worst case: ['Some Header', 'Another Header']

A:

You can use re.findall:
import re
x = '1.  Some Header.  and some more text 2.  Another Header.  And that is the end'
result = re.findall('\d+\.\s+[\w\s]+(?=[\.$])', x)

Output:
['1.  Some Header', '2.  Another Header']

