<?php $string = 'aaaaabbbcccccccccdddee'; var_export(preg_match_all('/(?:(.)\1{3,}(*SKIP)(*F)|(.)\2{2})/', $string, $m) ? $m[0] : 'no matches');
You have javascript disabled. You will not be able to edit any code.