Is there a pythonic preferred way to do this that I would do in C++:
for s in str: if r = regex.match(s): print r.groups()
I r
How about
for r in [regex.match(s) for s in str]: if r: print r.groups()
or a bit more functional
for r in filter(None, map(regex.match, str)): print r.groups()