Giusto:
codice:
$text = preg_replace('/#([\w]+)/e', "strtolower('$con')", $text);