Switch from the deprecated ereg to preg_match