View Single Post
  #4 (permalink)  
Old 11-20-04, 08:27 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
something like this?
PHP Code:

$ip '82.181.38.134';

$msg preg_replace("#((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]))#sie""stripslashes('\<a href=\"page.php?\\1\"\>\\1\</a\>')"$ip);
echo 
$msg
and btw.. the part matching the ip MUST be one long line..
and also i would like to point out that your code also accepts 999.999.999.999 witch is a invalid ip.
hope it helps
Reply With Quote