fork(8) download
  1. import re
  2.  
  3. for s in [ "xyzzyxxyzzyxxyzzyx", "abcbaccbaabcbaccbaabcbaccba", "iiiiiiiiiiiiiiiiii" ]:
  4. print(re.sub(r'(.+?)\1+', r'\1', s))
Success #stdin #stdout 0.08s 10864KB
stdin
Standard input is empty
stdout
xyzzyx
abcbaccba
i