内容摘要:
FunctioncloseHTML(strContent)DimarrTags,i,OpenPos,ClosePos,re,strMatchs,j,MatchSetre=NewRegExpre.IgnoreCase=Truere.Global=TruearrTags=Array('p','div','span','table','ul','font','b'......
|
FunctioncloseHTML(strContent)
DimarrTags,i,OpenPos,ClosePos,re,strMatchs,j,Match
Setre=NewRegExp
re.IgnoreCase=True
re.Global=True
arrTags=Array("p","div","span","table","ul","font","b","u","i","h1","h2","h3","h4","h5","h6")
Fori=0ToUBound(arrTags)
OpenPos=0
ClosePos=0
re.Pattern="\<"+arrTags(i)+"([^\<\>]+|)\>"
SetstrMatchs=re.Execute(strContent)
ForEachMatchinstrMatchs
OpenPos=OpenPos+1
Next
re.Pattern="\</"+arrTags(i)+"\>"
SetstrMatchs=re.Execute(strContent)
ForEachMatchinstrMatchs
ClosePos=ClosePos+1
Next
Forj=1ToOpenPos-ClosePos
strContent=strContent+"</"+arrTags(i)+">"
Next
Next
closeHTML=strContent
EndFunction
|