国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp自動補全html標簽自動閉合(正則表達式)

2024-05-04 10:59:41
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:
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

您可能感興趣的文章:

php過濾HTML標簽、屬性等正則表達式匯總asp.net正則表達式刪除指定的HTML標簽的代碼Java/Js下使用正則表達式匹配嵌套Html標簽移除HTML標簽的正則表達式用正則表達式格式化html標簽的代碼請教一個正則表達式,匹配所有Html標簽外部的指定字符串使用正則表達式去除所有html標簽只保留文字
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 油尖旺区| 内江市| 临沭县| 嫩江县| 东兴市| 扎兰屯市| 五大连池市| 云霄县| 武宣县| 遵化市| 兴文县| 徐州市| 什邡市| 湖口县| 宝兴县| 弋阳县| 瑞安市| 石嘴山市| 沙河市| 石阡县| 保定市| 泗水县| 德格县| 甘肃省| 博野县| 深圳市| 康马县| 盘山县| 迁西县| 南召县| 霞浦县| 抚州市| 楚雄市| 玉林市| 睢宁县| 罗山县| 满洲里市| 郸城县| 宁陕县| 乃东县| 买车|