RegExpFunction.asp
上传用户:rblchem
上传日期:2022-04-27
资源大小:1941k
文件大小:1k
- <%
- Function RegExpHtml(Source,RegExpType)
- Set SRegExp=New RegExp
- SRegExp.IgnoreCase =True
- SRegExp.Global=True
- RegExpType=Cstr(RegExpType)
- If Instr(RegExpType,"[NoModify]")>0 Then
- RegExpHtml=Source
- Exit Function
- End If
- If Instr(RegExpType,"[NoJavaScriptAndHtml]")>0 Then
- SRegExp.Pattern="<[a-zA-Z][^>]*sonw+=(w+|'[^']*'|""[^""]*"")[^>]*>"
- Source= SRegExp.Replace(Source,"")
- SRegExp.Pattern="<[^>]*>"
- Source= SRegExp.Replace(Source,"")
- SRegExp.Pattern="<"
- Source= SRegExp.Replace(Source,"<")
- End If
- If Instr(RegExpType,"[SimpleNoHtml]")>0 Then
- SRegExp.Pattern="<[^>]*>"
- Source= SRegExp.Replace(Source,"")
- SRegExp.Pattern="<"
- Source= SRegExp.Replace(Source,"")
- End If
- If Instr(RegExpType,"[SimpleNoUBB]")>0 Then
- SRegExp.Pattern="[[^]]*]"
- Source= SRegExp.Replace(Source,"")
- End If
- If Instr(RegExpType,"[AuthorInBracket]")>0 Then
- IF RegExpTest("(.+)",Source) then
- SRegExp.Pattern="(.+)"
- Set Match = SRegExp.Execute(Source)
- IF MATCH.COUNT<>0 THEN
- Source=Match(0).value
- Source=Replace(Source,CHR(40),"")
- Source=Replace(Source,CHR(41),"")
- Else
- Source=Source
- End IF
- Else
- Source=Source
- End IF
- End If
- If Instr(RegExpType,"[BadFilter]")>0 Then
- SRegExp.Pattern=badfilterWord
- Source= SRegExp.Replace(Source,"**")
- End If
- RegExpHtml=Source
- If RegExpHtml="" then
- RegExpHtml="..."
- End If
- Set SRegExp=Nothing
- End Function
- %>