关于正则,求高手帮助
如例:
http://bbs.csdn.net/topics/new?forum_id=PHP
http://www.bdyy.cc/detail/?20236.html
http://www.qq.com/html/?20236.html?id=88888
preg_match('/(http:\/\/)(.*)(\/)/',$rrr,$matches);
如何分别正则出:
bbs.csdn.net
www.bdyy.cc
www.qq.com
[解决办法]
$s=<<<txt
http://bbs.csdn.net/topics/new?forum_id=PHP
http://www.bdyy.cc/detail/?20236.html
http://www.qq.com/html/?20236.html?id=88888
txt;
preg_match_all('/http:\/\/([^\/]+)\//s',$s,$matches);
print_r($matches[1]);