Use preg_replace_callback instead of the deprecated /e modifier with preg_replace

The /e modifier is deprecated as of PHP 5.5.0