Tim,
you can solve both these problems by using Perl Compatible Regular Expressions (PCRE). There is an extensive manual on the PHP site (http://www.php.net) or you can use the Perl manpages (http://www.perl.com). The book to read is "Mastering Regular Expressions" by Jeffrey Friedl, O'Reilly.
For your first problem you need to use a method called negative lookbehind, which is an assertion that a sub-pattern does not occour before the pattern being matched.
<code>
$vText = preg_replace(
"#(?<!href=\")http://[-\w\d/.?=_~]*[\w\d/]#i",
"<a href=\"\0\">\0</a>",
$vText);
</code>
Note that this method will not work if there is an anchor in the orginal text containing the text "http://" in the body of the tag. E.g.
<a href="http://php.net">http://php.net</a>
will not work.
For your second problem, you need to use the \b modifier which specifies a word boundary.
<code>
$vText = preg_replace(
"#\bUKF\b#", "whatever", $vText
);
</code>
If you need more help, send me an email.
Jonathan Kahn
jonathan@wycombe-online.net