<script language="vbs">
alert( testVBS(textarea1.value))
function testVBS(str)
Set regEx = New RegExp
regEx.Pattern="(<img )(.*)?( src=(.*)?>)"
regEx.IgnoreCase=true
regEx.Global=true
testVBS =regEx.Replace(str,"$1$3")
end function
</script>
<script>
alert( test(textarea1.value));
function test(str){
var regEx = new RegExp('(<img )(.*)?( src="(.*)?\">)',"ig");
var arr = regEx.exec(str);
var re = RegExp.$1 + RegExp.$3;
return(re);
}
</script>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>过滤</title>
</head>
<body>
<%
dim test1
test1=Trim(Request.Form("textfield1"))
Response.Write(test1)
Function CheckStr(byVal Str)
Dim re'定义正则表达式
Set re=new RegExp
re.IgnoreCase =True'忽略大小写
re.Global=True'全局可用
re.Pattern="(onLoad=\x22.*\x22\s)|(onMouseWheel=\x22.*\x22\s)"'
Str=re.Replace(Str,"")
CheckStr=Str
End Function