fork download
  1. import re
  2. var1 = "we have hotel in Singapore and we have motel as well in Singapore, please let us know about your plan of visit and we will tell you more about venue and locations around us."
  3. print(set([x.group() for x in re.finditer(r'\b([a-zA-Z]{3,})\b(?=.*\b\1\b)', var1)]))
Success #stdin #stdout 0.03s 9736KB
stdin
Standard input is empty
stdout
{'Singapore', 'have', 'about', 'and'}