巧用asp語言過濾html元素
來源:易賢網(wǎng) 閱讀:1074 次 日期:2014-08-22 15:53:02
溫馨提示:易賢網(wǎng)小編為您整理了“巧用asp語言過濾html元素”,方便廣大網(wǎng)友查閱!

巧用asp語言過濾html元素:

'過濾html

'函數(shù)名:GlHtml

'作 用:過濾html 元素

'參 數(shù):str ---- 要過濾字符

'返回值:沒有html 的字符

'**************************************************

Public Function GlHtml(ByVal str)

If IsNull(str) Or Trim(str) = "" Then

GlHtml = ""

Exit Function

End If

Dim re

Set re = New RegExp

re.IgnoreCase = True

re.Global = True

re.Pattern = "(<.[^<]*>)"

str = re.Replace(str, " ")

re.Pattern = "(</[^<]*>)"

str = re.Replace(str, " ")

Set re = Nothing

str = Replace(str, "'", "")

str = Replace(str, Chr(34), "")

GlHtml = str

End Function

更多信息請查看IT技術專欄

更多信息請查看網(wǎng)絡編程
易賢網(wǎng)手機網(wǎng)站地址:巧用asp語言過濾html元素
關于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網(wǎng)