学习电脑,计算机系统故障维护,电脑技术,电脑知识学习-就上第二电脑网
当前位置: 首页 > 网络编程 > ASP编程

电影网站源码asp.netasp自动补全html标签自动闭合(正则表达式)

 更新时间: 2019-08-04 10:27:26   作者:第二电脑网   来源:第二电脑网   浏览数:705   我要评论

复制代码电脑技术002pc网认为此文章对《电影网站源码asp.etasp自动补全html标签自动闭合(正则表达式)》说的很在理,第二电脑网为你提供最佳的电脑知识网,电脑基础教程。 代码
复制代码

电脑技术002pc网认为此文章对《电影网站源码asp.netasp自动补全html标签自动闭合(正则表达式)》说的很在理,第二电脑网为你提供最佳的电脑知识网,电脑基础教程。

代码如下:
Function closeHTML(strContent)
Dim arrTags, i, OpenPos, ClosePos, re, strMatchs, j, Match
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
arrTags = Array("p", "div", "span", "table", "ul", "font", "b", "u", "i", "h1", "h2", "h3", "h4", "h5", "h6")
For i = 0 To UBound(arrTags)
OpenPos = 0
ClosePos = 0


re.Pattern = "\<" + arrTags(i) + "( [^\<\>]+|)\>"
Set strMatchs = re.Execute(strContent)
For Each Match in strMatchs
OpenPos = OpenPos + 1
Next
re.Pattern = "\</" + arrTags(i) + "\>"
Set strMatchs = re.Execute(strContent)
For Each Match in strMatchs
ClosePos = ClosePos + 1
Next
For j = 1 To OpenPos - ClosePos
strContent = strContent + "</" + arrTags(i) + ">"
Next
Next
closeHTML = strContent
End Function

更多:电影网站源码asp.netasp自动补全html标签自动闭合(正则表达式)
https://www.002pc.comhttps://www.002pc.com/aspbiancheng/3623.html

你可能感兴趣的自动,补全,asp,html,正则表达式,标签

    关于我们 - 广告合作 - 联系我们 - 免责声明 - 网站地图 - 投诉建议 - 在线投稿

      浙ICP备140365454号

    ©CopyRight 2008-2020 002pc.COM Inc All Rights Reserved. 第二电脑网 版权所有 联系QQ:282523118