import re 
a=re.compile(r'(ha){3}')
r=a search ('hahaha')
print(r. group ())

Posted on by