【发布时间】:2011-05-20 12:24:50
【问题描述】:
需要一个正则表达式(使用 PHP)来匹配一个域名。例子:
http://sub.domain.com/somefolder/index.html -> domain.com
somedomain.info -> somedomain.info
http://anotherdomain.org/home -> anotherdomain.org
www.subdomain.anothersubdomain.maindomain.com/something/ -> maindomain.com
【问题讨论】: