asp自动补全html标签自动闭合(正则表达式)
2013-09-03 15:34
495 查看
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自动补全html标签自动闭合(正则表达式)
- php使HTML标签自动补全闭合函数代码
- ASP.NET正则表达式提取网页网址、标题、图片实例以及过滤所有HTML标签实例
- asp.net 正则表达式过滤所有html标签
- js自动闭合html标签,自动补全html标记
- php使HTML标签自动补全闭合函数代码
- 运用正则表达式在Asp中过滤Html标签代码的四种不同方法
- asp.net正则表达式提取网页网址、标题、图片,滤所有HTML标签
- asp.net正则表达式提取网页网址、标题、图片,滤所有HTML标签
- asp.net正则表达式提取网页网址、标题、图片实例以及过滤所有HTML标签实例
- asp之自动闭合HTML/ubb标签函数+简单注释
- js自动闭合html标签,自动补全html标记
- asp.net正则表达式提取网页网址、标题、图片实例以及过滤所有HTML标签实例
- asp.net正则表达式删除指定的HTML标签的代码