Fixing deprecated warning for preg_replace function and PHP 5.5