how to get all substrings that match regex pytyon code example Example: find all regex matches python matches = re.findall(r"xxx|yyy", a_string)