I have a file that has a repeated pattern output
!-----------------------------------------------------------------
line 1
line 2
line 3
.....
-------------------------------------------------------------------!
I am trying to match and extract all the occurrences of these blocks but the below returns all the file
match = re.search(r'\!-.*-\!', data, re.DOTALL)
print match.group()