Use preg_replace_callback instead of /e (deprecated)

The `/e` modifier has been deprecated in PHP 5.5, we should use `preg_replace_callback()` instead.