trying to fix this regex. Its supposed to find any hyperlinks in a string and put anchor tags around them. Keeps coming back, unkown identifier '+'. I thought the plus sing was part of regex?
<?php
//replace links with clickable links
// match protocol://address/path/
$comments = preg_replace("[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*", "<a href=\"\\0\">\\0</a>", $comments);
// match www.something
$comments = preg_replace("(^| )(www([.]?[a-zA-Z0-9_/-])*)", "\\1<a href=\"http://\\2\">\\2</a>", $comments);
?>
any help appreciated.