all_text = '"v1Cd5Yk6x_f2cqrqNV6Iy_1ab34_dfI" + l'
modules = re.findall(r'([\w.]+)+(?=\.\w+)\b', all_text)
When the code contains the above text, it will be executed for several minutes when searching for module.
After changing to the following regex, it will be executed very quickly.
all_text = '"v1Cd5Yk6x_f2cqrqNV6Iy_1ab34_dfI" + l'
modules = re.findall(r'(?<!\w)([a-zA-Z_]\w*)\.\w+\b', all_text)
When the code contains the above text, it will be executed for several minutes when searching for module.
After changing to the following regex, it will be executed very quickly.