Skip to content

Instantly share code, notes, and snippets.

import re
with open("infile.txt", "r") as fp:
queue=""
match=r"[?!.]+\s+"
for rawLine in fp:
rawLine=" ".join((queue, rawLine))
queue=""
lines=rawLine.split(match)
if re.search(match+"$", rawLine):