fork download
  1. import re
  2.  
  3. pattern = r"^([A-Z][a-z]*(?:[^\S\n]+[A-Z][a-z]*)*)\n\n((?:(?![A-Z][a-z]+(?:[^\S\n]+[A-Z][a-z]*)*$).*(?:\n|$))+)"
  4.  
  5. s = ("This Is A Title\n\n"
  6. "This is where the body starts.\n\n"
  7. "And this is more body.")
  8.  
  9. print(re.findall(pattern, s))
Success #stdin #stdout 0.02s 9524KB
stdin
Standard input is empty
stdout
[('This Is A Title', 'This is where the body starts.\n\nAnd this is more body.')]