$str = 'this is: foobar'; $str = preg_replace('[^:]+:', ' ', $str); //expected output foobar echo $str;