title: Find out how many times a regex matches in a string in Python
body: <p>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 <code>"It actually happened when it acted out of turn."</code></p>
  
  <p>I want to know how many times <code>"t a"</code> appears in the string. In that string, <code>"t a"</code> appears twice. I want my function to tell me it appeared twice. Is this possible?</p>