Regex to remove repeated character pattern in a string,"re.sub('^(.+?)\\1+$', '\\1', input_string)"