with open('file.txt') as fh:
    for line in fh:
        if line.startswith('# REG '):
            reg = line.split()[2]
blocklist = []
for line in fh:
    if line.startswith('# reg '):
        block = ''.join(blocklist)
break
blocklist.append(line)
самый быстрый способ разобрать большой текст в python