asp匹配網(wǎng)址的正則
更新時間:2023年06月20日 11:23:47 投稿:mdxy-dxy
這篇文章主要介紹了asp匹配網(wǎng)址的正則,需要的朋友可以參考下
判斷是不是正確的網(wǎng)址
Function?IsValidUrl(str)? ?Dim?regEx? ?Set?regEx?=?New?RegExp? ?regEx.Pattern?=?"http(s)?://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?"? ?IsValidUrl?=?regEx.Test(str)? End?Function?
ASP正則表達式解析出網(wǎng)址中的域名部分
Function getDomain(domain) Dim re,ReturnStr,Matches Set re=new RegExp re.IgnoreCase =True re.Global=True re.Pattern = "(\w+\.(com.cn|net.cn|com|cn|net|org))" Set Matches = re.Execute(domain) ReturnStr = "" For Each Match in Matches ReturnStr = Match.Value Exit for Next getDomain = ReturnStr Set re=Nothing End Function response.write getDomain("http://www.dbjr.com.cn/abc.html")
到此這篇關于asp匹配網(wǎng)址的正則的文章就介紹到這了,更多相關asp匹配網(wǎng)址內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
JS正則表達式匹配檢測各種數(shù)值類型(數(shù)字驗證)
這篇文章主要介紹了JS正則表達式匹配檢測各種數(shù)值類型(數(shù)字驗證)的相關資料,非常不錯,具有參考借鑒價值,需要的朋友參考下吧2016-08-08在Asp中用“正則表達式對象”來校驗數(shù)據(jù)的合法性
在Asp中用“正則表達式對象”來校驗數(shù)據(jù)的合法性...2007-03-03