import re
text = "  \t  hello there\n  \t  how are you?\n  \t HHHH"
match = re.search(r'(?m)\A(.*).*(?:\n?^\1.*$)*\n?\Z', text)
print ("'" + match.group(1) + "'")