Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > asp技巧

asp自动补全html标签自动闭合(正则表达式)

来源:中文源码网    浏览:145 次    日期:2024-05-14 12:54:21
【下载文档:  asp自动补全html标签自动闭合(正则表达式).txt 】


asp自动补全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 = "\" Set strMatchs = re.Execute(strContent) For Each Match in strMatchs ClosePos = ClosePos + 1 Next For j = 1 To OpenPos - ClosePos strContent = strContent + "" Next Next closeHTML = strContent End Function

相关内容