欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp自動補(bǔ)全html標(biāo)簽自動閉合(正則表達(dá)式)

 更新時(shí)間:2012年10月04日 19:31:25   作者:  
asp自動補(bǔ)全html標(biāo)簽自動閉合,方便asp截取帶有html標(biāo)簽的內(nèi)容,防止頁面變形
復(fù)制代碼 代碼如下:

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

相關(guān)文章

最新評論