Hi Rpanning,
your pattern matches everything from the beginning of the string until the first slash. So if $text was
"it displays http://www.myurl.com but not www.myurl.com"
you would match the bold part.
Kristijan,
here's one that will match any sequence of characters starting with 'http://' or 'www.', adding 'http://' in the link if necessary.
$text = preg_replace("#(http://([\s]+))|(www.[\s]+)#i", "<a href=\"http://$2$3\">$1$3</a>", $text);
Note that anything following http:// or www. until the next space is considered to be a url, so it may create invalid links like www.1. To change this, you might want to break down the [\s]+ into more specific subpattern.
Hope this helps,
xblue