Exercise 1 solution import re s = "The Cat sat; a DOG barked; cats and dogs; concat" found = re.findall(r"\b(?:cat|dog)s?\b", s, re.I) print(found) # ['Cat', 'DOG', 'cats', 'dogs'] print(len(found)) # 4 print(re.findall(r"cat|dog", s, re.I)) # ['Cat', 'DOG', 'cat', 'dog', 'cat'] (All lines were run and printed exactly what is shown.) Explanation: the \b boundaries on both sides, plus the (?:...) group around the choice, limit matches to whole words, and s? allows the plural. The naive pattern has no boundaries, so it also finds pieces of "cats", "dogs" and "concat" and drops the plural s. re.I makes "Cat" and "DOG" match in both.