updated method that generates text signatures because ereg_replace is deprecated in PHP5.3