Conceptual

Finding All Matches with re.findall and re.finditer

re.search stops at the first match; findall returns every match as a list and finditer returns them lazily with position information. Choosing wrongly is why a script that works on a one-match sample silently drops data on real input.