Im quite new to regex patterns. Im having difficulty parsing a text file and returning the matches per paragraph. So basically every paragraph is unique.
Here is my example text file
A quick brown
fox jumps over
the lazy dog;
1234;
Here is
the second paragraph
123141
I want is matches[0] to be: #A quick brown fox jumps over the lazy dog; 1234;
matches[1] to be: #Here is the second paragraph 123141
I've tried
regex = re.compile(r"(.*\n)\n", re.MULTILINE)
with open(file_dir, "r") as file:
matches = regex.findall(file.read())
print matches
But the result is ['1234;\n']. It doesnt capture the whole paragraph, and it didnt capture the second as well. What is the most efficient way of doing this?