fork download
  1. import re
  2.  
  3. regex = r"(?<!\S)(\d+\.[^.]+)\."
  4. test_str = "1. Some Header. and some more text 2. Another Header. And that is the end"
  5. print(re.findall(regex, test_str))
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
['1. Some Header', '2. Another Header']