以后地位:首页 > 建站常识 > 列表

asp正则抒发式过滤标签html,style ,div,font,span,Object,iframe

点击: 次时候:2017/11/24关头词:上海网站设想 asp正则抒发式
<%'过滤 一切 html :Function WordStrHtml(ConStr) Dim tmpReStr, regEx tmpReStr = CStr(ConStr) Set regEx = New RegExp regEx.Pattern =
正则抒发式

<%

'过滤 一切 html :

Function WordStrHtml(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "<\/*[^<>]*>"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrHtml = tmpReStr

End Function

'过滤 style :

Function WordStrStyleTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "(<style)+[^<>]*>[^\0]*(<\/style>)+"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrStyleTag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 层 div :

Function WordStrDivTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "<(\/){0,1}div[^<>]*>"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrDivTag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 链接 a :

Function WordStrATag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "<(\/){0,1}a[^<>]*>"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrATag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 字体 font :

Function WordStrFontTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "<(\/){0,1}font[^<>]*>"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrFontTag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 span :

Function WordStrSpanTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "<(\/){0,1}span[^<>]*>"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrSpanTag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 Object :

Function WordStrObjectTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "<object.*?/object>"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrObjectTag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 iframe:

Function WordStrIFrameTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "(<iframe){1,}[^<>]*>[^\0]*(<\/iframe>){1,}"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrIFrameTag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 script:

Function WordStrScriptTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "(<script){1,}[^<>]*>[^\0]*(<\/script>){1,}"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrScriptTag = tmpReStr

   Set regEx = Nothing

End Function

'过滤 Class :

Function WordStrClassTag(ConStr)

   Dim tmpReStr, regEx

   tmpReStr = CStr(ConStr)

   Set regEx = New RegExp

   regEx.Pattern = "(class=){1,}(""|\'){0,1}\S+(""|\'|>|\s){0,1}"

   regEx.IgnoreCase = True

   regEx.Global = True

   tmpReStr = regEx.WordStr(tmpReStr, "")

   WordStrClassTag = tmpReStr

   Set regEx = Nothing

End Function

%>

预定建站
收费供给网站优化
支付关头词