Woops, posted at the same time.
I read about preg_replace() in the manual, but I didn't see references to this...
I copied your code, but it didn't work, I got the error I thought I was going to get: Parse error: syntax error, unexpected T_DNUMBER, expecting T_VARIABLE or '$' in /home/www/script/funcs.php on line 23
Here's my code:
<?php
$output = preg_replace("/(http:\/\/www.[\s\t\n]*)[\s|\t|\n]/i","<a href=\"javascript:void(0);\" onclick=\"popUp('$1');\" title=\"$1\">[link]</a>",$input);
echo $input."<hr>...converted to...<hr>".$output;
?>