
asp 正则标签替换
Functionoflink_lcasetag(imgstrng)DimregEx,Match,Matches'建立变量。SetregEx=NewRegExp'建立正则表...
Function oflink_lcasetag(imgstrng)
Dim regEx, Match, Matches '建立变量。
Set regEx = New RegExp '建立正则表达式。
regEx.Pattern = "<.+?\>" '设置模式。
regEx.IgnoreCase = true '设置是否区分字符大小写。
regEx.Global = True '设置全局可用性。
Set Matches = regEx.Execute(imgstrng) '执行搜索。
imgstrng=imgstrng
For Each Match in Matches '遍历匹配集合。
imgstrng=replace(imgstrng,Match.Value,lcase(Match.Value))
Next
oflink_lcasetag = imgstrng
End Function
网上找到上面的正则,实测成功,但想在这个基础上加个替换
把<br>替换成<br />,<hr>替换成<hr /> 展开
Dim regEx, Match, Matches '建立变量。
Set regEx = New RegExp '建立正则表达式。
regEx.Pattern = "<.+?\>" '设置模式。
regEx.IgnoreCase = true '设置是否区分字符大小写。
regEx.Global = True '设置全局可用性。
Set Matches = regEx.Execute(imgstrng) '执行搜索。
imgstrng=imgstrng
For Each Match in Matches '遍历匹配集合。
imgstrng=replace(imgstrng,Match.Value,lcase(Match.Value))
Next
oflink_lcasetag = imgstrng
End Function
网上找到上面的正则,实测成功,但想在这个基础上加个替换
把<br>替换成<br />,<hr>替换成<hr /> 展开
展开全部
Function oflink_lcasetag(imgstrng)
Dim regEx, Match, Matches '建立变量。
Set regEx = New RegExp '建立正则表达式。
regEx.Pattern = "<.+?\>" '设置模式。
regEx.IgnoreCase = true '设置是否区分字符大小写。
regEx.Global = True '设置全局可用性。
Set Matches = regEx.Execute(imgstrng) '执行搜索。
imgstrng=imgstrng
For Each Match in Matches '遍历匹配集合。
imgstrng=replace(imgstrng,Match.Value,lcase(Match.Value))
imgstrng=replace(imgstrng,"<br>","<br />")
imgstrng=replace(imgstrng,"<hr>","<hr />")
Next
oflink_lcasetag = imgstrng
End Function
Dim regEx, Match, Matches '建立变量。
Set regEx = New RegExp '建立正则表达式。
regEx.Pattern = "<.+?\>" '设置模式。
regEx.IgnoreCase = true '设置是否区分字符大小写。
regEx.Global = True '设置全局可用性。
Set Matches = regEx.Execute(imgstrng) '执行搜索。
imgstrng=imgstrng
For Each Match in Matches '遍历匹配集合。
imgstrng=replace(imgstrng,Match.Value,lcase(Match.Value))
imgstrng=replace(imgstrng,"<br>","<br />")
imgstrng=replace(imgstrng,"<hr>","<hr />")
Next
oflink_lcasetag = imgstrng
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询