摘要:直接贴代码,简单不用说明: static class Program { ///<summary> /// The main entry point for the application. ///</summary> [STAThread] static void Main() { try { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.Catch...
阅读全文
摘要:Sub FilterSiteDomain() Dim siteUrl As String Dim siteDomain As String Dim siteMainDomain As String siteUrl = "http://www.baidu.com/a/b/index.html" '获取URL域名 siteDomain = GetSiteByUrl(siteUrl) MsgBox siteDomain '获取URL主域名 siteMainDomain = GetSiteDomain(siteDomain) MsgBox s...
阅读全文
摘要:打开Excel,Shift + F11 打开VBA编辑器,注意高度时必须先保存,否则会提示无法高度外部程序。Sub RegexURL()Dim url As StringDim regex As Objecturl = "http://www.baidu.com/a/b/index.html"Set regex = CreateObject("vbscript.regexp")regex.Global = Trueregex.Pattern = "(\w+)://([^/:]+)(:\d*)?([^# ]*)"MsgBox regex
阅读全文