加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用正则表达式vb从网址提取根域名

发布时间:2020-12-14 04:34:04 所属栏目:百科 来源:网络整理
导读:Imports System.Text.RegularExpressions Dim MatchVale As String = String.Empty Dim myrule As New Regex("(^(w*://)?(w*.)+(com.cn|com|net.cn|net|org.cn|org|gov.cn|gov|cn|mobi|me|info|name|biz|cc|tv|asia|hk|网络|公司|中国)).*$") Dim m As Ma

Imports System.Text.RegularExpressions


Dim MatchVale As String = String.Empty

Dim myrule As New Regex("(^(w*://)?(w*.)+(com.cn|com|net.cn|net|org.cn|org|gov.cn|gov|cn|mobi|me|info|name|biz|cc|tv|asia|hk|网络|公司|中国)).*$")

Dim m As Match = myrule.Match(url) MatchVale = m.Groups(1).ToString Return MatchVale

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读