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

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

相关文章

jquery.validate使用攻略(表单校验) 目录 jquery.validate...
/\s+/g和/\s/g的区别 正则表达式/\s+/g...
自整理几个jquery.Validate验证正则: 1. 只能输入数字和字母...
this.optional(element)的用法 this.optional(element)是jqu...
jQuery.validate 表单动态验证 实际上jQuery.validate提供了...
自定义验证之这能输入数字(包括小数 负数 ) <script ...