try:
$str="fdfsdfsfasdg DDDDDDDDDDDDDDDDDDDDDDDDD fffffffsdgggeaeagdfdfdfdfdfdfd"; 
echo preg_replace('/(\S)\\1{4,}/','',$str);