for m in re.finditer(scrape, telnetout): print "Agent: %s Name: %s Status: %s Cha: %s\n" %( m.group(1), m.group(2), m.group(3), m.group(4)