bwgoudey <[email protected]> writes:
> elif re.match("^DATASET:\s*(.+) ", line):
> m=re.match("^DATASET:\s*(.+) ", line)
> print m.group(1))
Sometimes I like to make a special class that saves the result:
class Reg(object): # illustrative code, not tested
def match(self, pattern, line):
self.result = re.match(pattern, line)
return self.result
Then your example would look something like:
save_re = Reg()
....
elif save_re.match("^DATASET:\s*(.+) ", line):
print save_re.result.group(1)
--
http://mail.python.org/mailman/listinfo/python-list