May-14-2024, 12:27 PM
(May-14-2024, 05:59 AM)deanhystad Wrote:import re matches =[match.group() for match in re.finditer(r"(.)\1{1,}", "AAAbbcDDDEDGGGG")] print(matches)
Output:['AAA', 'bb', 'DDD', 'GGGG']
Thank you, but this expression still allows matching consecutive characters other than exactly 3. Doubles, quads or others beside triples should not be found.