$url = "http://www.rntsoft.com"; $parts = ereg("^(http://www)\.([[:alnum:]]+)\.([[:alnum:]]+)", $url, $regs); echo $regs[0]; echo ""; echo $regs[1]; echo ""; echo $regs[2]; echo ""; echo $regs[3]; ?>