import re
regex = re.compile(r"(?m)^[\d]+.+\R", flags=re.UNICODE)
test_str = ("1576\n"
"01:14:04,440 --> 01:14:05,780\n"
"what's optimal daily allowance means. Which is good for 100 reasons.\n\n"
"1577\n"
"01:14:06,380 --> 01:14:09,970\n"
"That it's got to be much stronger than the RDA the recommended")
subst = ""
result = regex.sub(subst, test_str)
if result:
print(result)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html