Is there a way that I can find out how many matches of a regex are in a string in Python? For example, if I have the string \"It actually happened when it acted out of
\"It actually happened when it acted out of
Have you tried this?
len( pattern.findall(source) )