匹配顶级域名正则表达式 正则 匹配 顶级 域名

 

匹配顶级域名的正则  (?i)^https?://(?:\w+\.)*?(\w*\.(?:com\.cn|cn|com|net))[\\\/]*

 匹配顶级域名正则表达式 正则 匹配 顶级 域名_第1张图片

附带测试文本 

http://www.xiaomi.com/index.php
http://shop.coolpad.cn/9970.html
http://www.amazon.cn/gp/product/B00FTWNI44
http://item.taobao.com/item.htm?spm=a230r.1.14.3.NH5uRv&id=25823204768
http://item.jd.com/927626.html
http://item.jd.com/893146.html?utm_source=mb.it168.com&utm_medium=tuiguang&utm_campaign=t_20_66757411547&utm_term=5dbc118393e647a5a7c4b39eb8ce2eae
http://stopic.okhqb.com/xiaomi_yaohao.html
http://item.yixun.com/item-646420.html?YTAG=3.706045212210
http://tuan.jd.com/team-11349259.html
http://detail.tmall.com/item.htm?id=13307990601
http://shop.coolpad.cn/130901.html
http://www.gome.com.cn/product/9125263147.html
http://www.shouji.3c.tmall.com/item.htm?id=13307990601
http://www.shop.lenovomobile.com
http://www.store.logitech.com.cn

你可能感兴趣的:(正则表达式)