Use preg_replace_callback instead of /e in preg_replace

Use preg_replace_callback instead of /e in preg_replace to fix E_DEPRECATED warnings in php-5.5