欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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ù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論