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 />
展开
 我来答
开发者之路
2010-05-25 · TA获得超过910个赞
知道大有可为答主
回答量:2031
采纳率:0%
帮助的人:965万
展开全部
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
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式