怎么样
for r in [regex.match(s) for s in str]: if r: print r.groups()
或更实用
for r in filter(None, map(regex.match, str)): print r.groups()

怎么样
for r in [regex.match(s) for s in str]: if r: print r.groups()
或更实用
for r in filter(None, map(regex.match, str)): print r.groups()