正则:获取链接的主要域名
https://pianpai.com/xxxadas 1https:\/\/[^\/]+ 获取结果为:https://pianpai.com http与https的区别 http://pianpai.com/yyyyyyy 1http:\/\/[^\/]+ 获取结果为:http://pianpai.com (more...)
https://pianpai.com/xxxadas 1https:\/\/[^\/]+ 获取结果为:https://pianpai.com http与https的区别 http://pianpai.com/yyyyyyy 1http:\/\/[^\/]+ 获取结果为:http://pianpai.com (more...)
参考:http://www.cnblogs.com/dudumao/p/3599486.html (感谢) (more...)