fork(2) download
  1. import re
  2. text = " \t hello there\n \t how are you?\n \t HHHH"
  3. match = re.search(r'(?m)\A(.*).*(?:\n?^\1.*$)*\n?\Z', text)
  4. print ("'" + match.group(1) + "'")
Success #stdin #stdout 0.09s 10840KB
stdin
Standard input is empty
stdout
'  	 '