#!/usr/bin/env python import re file = open("file.txt", "r") regex = re.compile(r'xy ') for line in file: preamble = regex.findall(line) for word in preamble: print(""+ str(word))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)