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
This might be an overly simplistic answer, but would you consider this:
for s in str: if regex.match(s): print regex.match(s).groups()