<?
error_reporting(0);
$sha = '(www)\.[a-z0-9A-Z]{1,100}\.(com)';
$path = 'file.htm';
$end = array();
$link = '';
$file = fopen($path, 'r');
while(!feof($file))
{$_file = fgets($file);
if(ereg($sha, $_file, $link))
{array_push($end, $link['0']);}}
fclose($file);
$end = array_unique($end);
foreach($end as $key => $val)
{echo $val.'<br>';}
?>