I\'m trying to find characters that are repeated 3 times or more, for example I want to take the following strings:
(\'aaa\', \'buuuuut\',
\'aaa\'
\'buuuuut\'
>>> s = 'abbcccffffdd' >>> s = re.sub(r'(\w)\1(\1+)',r'\1',s) >>> s 'abbcd'