>>>s="""#serverxx-3:80weight=1max_fails=2fail_timeout=10sbackup;
serverxx:80weight=1max_fails=2fail_timeout=10s;
serveryyweight=1max_fails=2fail_timeout=10sbackup;
server192.168.1.1weight=1max_fails=2fail_timeout=10s;
serverxx:9090max_fails=2fail_timeout=10sbackup;
server192.168.1.1weight=1max_fails=2fail_timeout=10s;
"""
>>>importre
>>>re.findall('^[^#\n]*server[\t]+([^:\s]+)',s,re.M)
['xx','yy','192.168.1.1','xx','192.168.1.1']
>>>