Finding Multiple Instances

Let's explore what can be done with multiple matches in a string.

Up to this point, all we’ve seen is how to find the first match in a string. But what if we have a string that has multiple matches in it.

Let’s review how to find a single match:

Press + to interact
import re
silly_string = "the cat in the hat"
pattern = "the"
match = re.search(pattern, silly_string)
print (match.group())

Now we can see that there are ...