1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/usr/bin/env python3 import os import sys import re m = re.compile("^[0-9a-z]+sums=\(") lookend = False for line in sys.stdin: if m.search(line): lookend = True if lookend: if ')' in line: lookend = False continue print(line, end='')