if __name__ == '__main__':
    data = open('x').read()
RE = re.compile('.*form="(.*)" lemma="(.*)" postag="(.*?)"', re.M)
matches = RE.findall(data)
for m in matches:
    pass
Python: Reading part of a text file