得到连接和图片的地址 正则
(编辑:jimmy 日期: 2024/11/15 浏览:3 次 )
复制代码 代码如下:
function AddSiteURL(ByVal Str)
If IsNull(Str) Then
AddSiteURL = ""
Exit Function
End If
Dim re
Set re=new RegExp
With re
.IgnoreCase =True
.Global=True
.Pattern="<img (.*?)src="/UploadFiles/2021-04-02/"> str = .replace(str,"<img $1src="">
.Pattern="<a (.*?)href=""(?!(http|https|ftp|mms|rstp)://)(.*?)"""
str = .replace(str,"<a $1href=""" & SiteURL & "$3""")
End With
Set re=Nothing
AddSiteURL=Str
End Function
function AddSiteURL(ByVal Str)
If IsNull(Str) Then
AddSiteURL = ""
Exit Function
End If
Dim re
Set re=new RegExp
With re
.IgnoreCase =True
.Global=True
.Pattern="<img (.*?)src="/UploadFiles/2021-04-02/"> str = .replace(str,"<img $1src="">
.Pattern="<a (.*?)href=""(?!(http|https|ftp|mms|rstp)://)(.*?)"""
str = .replace(str,"<a $1href=""" & SiteURL & "$3""")
End With
Set re=Nothing
AddSiteURL=Str
End Function
下一篇:密码强度检测函数(正则)