Use preg_replace_callback for PHP 5.5