codice:
preg_replace('/<a(.*?)href="(.*?)"(.*?)>/is', '<a${1}href="#"${3}>', $string);
Tnx to Daniele_dll