I'm not really good with regexp :-) so in this case I would have used just substring - find the position of the third "/" and cut your string by that symbol. Not nice solution, nevertheless...
Or faster: explode your URL by "/":
$arr=explode("/", "www.domain.com/path/file.html");
$domain_name=$arr[0];