Fix for deprecated preg_replace