def iter_finds(regex_obj, s):
if isinstance(regex_obj, str):<EOL><INDENT>for m in re.finditer(regex_obj, s):<EOL><INDENT>yield m.group()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for m in regex_obj.finditer(s):<EOL><INDENT>yield m.group()<EOL><DEDENT><DEDENT>
Generate all matches found within a string for a regex and yield each match as a string