in Programming

How to read in Python a file between two lines

#!/urs/bin/python
import sys,re

if(__name__ == “__main__”):
with open(“Autosupport”) as f:
for l in f:
pattern=’^Replication Data Transferred over 24hr.*’
pattern2=’^Replication Detailed History’
if(re.match(pattern,l)):
print(l)
for l2 in f:
print (l2)
if (re.match(pattern2,l2)):
sys.exit(0)