eag = 'linux'
rpat = re.compile("^\s*%s\s*=\s*('.*\'')" % eag)
trying to grab r'^LIN' in a line in a text file, linux = r'^LIN',
lines = [line.strip() for line in open (myfile, 'r')]
for line in lines:
if re.match(rpat, line)
matched = re.match(rpat,line)
got_it = matched.group(1)
# do something here
Not quite sure if my rpat is correct
There is some space in the front of linux then some space until = then some space r'^LIN',