函数如下:
Function jugdetel(htmlStr)
if not isnull(htmlStr) then
Dim regEx
SET regEx = New Regexp
regEx.IgnoreCase = True '设置是否区分字符大小写
regEx.Global = True '设置全局可用性
regEx.Pattern = "<.+?>" '设置模式
jugdetel = regEx.Test(htmlStr) '执行
SET regEx = Nothing
end if
End Function
返回true或者flase。值需要更换表达式:regEx.Pattern = "<.+?>" 中的<.+?>的就可以
本文介绍了一个VBScript函数,用于检测字符串中是否存在HTML标签。通过修改正则表达式的模式,可以灵活地应用于不同场景。
1400

被折叠的 条评论
为什么被折叠?



