I have been struggling with python regex for a while trying to match paragraphs within a text, but I haven\'t been successful. I need to obtain the start and end positions o
What is the newline symbol? Let us suppose the newline symbol is '\r\n', if you want to match the paragraphs starting with Lorem, you can do like this:
pattern = re.compile('\r\nLorem.*\r\n')
str = '...' # your source text
matchlist = re.findall(pattern, str)
The matchlist will contain all the paragragh start with Lorem. And the other two words are the same.