back-reference parenthesized substrings
<? $url = "Java2s (http://www.java2s.com)"; $url = ereg_replace("http://(([AZaz09.\-])*)", "<a href=\"\\0\">\\0</a>",$url); print $url; ?>