我有这样的字符串:
$str = 'This -----is a bbbb test';
如何删除所有出现超过3次的重复字符?
例如,上面的字符串必须如下所示:
'This is a test';
preg_replace()
$new_str = preg_replace('/(.)\1{3,}/', '', $str);
$t = preg_replace('/(\S)\1{3,}/', '', $t);