import re
greedyHaRegex = re.compile(r'(Ha){3, 5}')
mo1 = greedyHaRegex.search('HaHaHaHaHa')
mo1.group()
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
mo1.group()
AttributeError: 'NoneType' object has no attribute 'group'
I don't understand why this error occurred.