<?php
$target = "word1 <a stuff amazon> </a> word2 amazon";
$regex = "~(?i)<a.*?</a>(*SKIP)(*F)|amazon~";
$repl= '<a href="http://w...content-available-to-author-only...n.com">Amazon</a>';
$new=preg_replace($regex,$repl,$target);
echo htmlentities($new);
