back-reference parenthesized substrings : ereg_replace « String « PHP






back-reference parenthesized substrings

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








Related examples in the same category

1.ereg_replace
2.ereg_replace() function searches for string and replaces pattern if found.
3.ereg_replace-2
4.ereg_replace.php
5.Using ereg_replace