import re

some_var = "what what"

should_match = "what what what what what what hey"
not_a_match = "what what what what hey what what"

match = re.search(r"(?:\s*{0}){{3}}".format(re.escape(some_var)), should_match)
no_match = re.search(r"(?:\s*{0}){{3}}".format(re.escape(some_var)), not_a_match)

print match
print no_match