In the meantime someone sent me this solution, which works the way it should:
function showwordico($input)
{
return eregi_replace(
'<a href="[a-z]{3,}://[a-z0-9/_%.-]{1,}.doc">',
'<img src="pix/wordicon.gif"> \0' ,
$input);
}
My original didn't work with Linux / PHP 4.0.3, but it did work on Linux / PHP 4.0.6. Maybe there is a difference??