use regex.finditer instead of regex.findall