导航:首页 > 净水问答 > asp搜索过滤

asp搜索过滤

发布时间:2023-02-02 20:27:40

1. ASP中如何过滤指字文字前或指定文字后所有内容呢

可以用正则进行替换,例如以下代码可以替换a及以后的内所有容字符
<%
str="1234agds34.32"
Dim regEx
Set regEx=new RegExp
regEx.pattern="a.*"
regEx.IgnoreCase =false
regEx.Global=True
str=regEx.Replace(str,"00000")
Response.Write "aaa="&str
%>

2. ASP如何过滤数组内重复内容

dim a(4)
a(0)=1
a(1)=1
a(2)=2
a(3)=2
a(4)=3
for n=0 to ubound(a)-1
for s=1 to ubound(a)

if a(s)=a(n) then
a(n)=""

end if
next

next
a_new=filter(a,"")‘把a数组里面是空值的全部删掉,然后重新组合成一个a_new数组。
for n=0 to ubound(a_new)’打印出a_new数组。
response.write a_new(n)&"<br>"

next

说明:a_new是新生成的数组,去掉了a数组里面被清空的那些,重新生成了一个开头角标是0的a_new数组。

3. asp中如何过滤掉特殊字符

user=replace(trim(request.form("uName")),"'","''")
password=replace(trim(request.form("Password")),"'","''")
if instr(user,"%") or instr(user,"#") or instr(user,"?") or instr(user,"|") or instr(user,"'") then
response.write "<script language=javascript>alert('您的姓名含有非法字符!');this.location.href='login.asp';</script>"
response.end
end if

if instr(password,"%") or instr(password,"#") or instr(password,"?") or instr(password,"|") then
response.write "<script language=javascript>alert('您的密码含有非法字符!');this.location.href='login.asp';</script>"
response.end
end if 我自己做的,希望对你有帮助

阅读全文

与asp搜索过滤相关的资料

热点内容
机油滤芯厂家在哪里 浏览:71
大金vrvn带提升泵吗 浏览:287
污水池太深怎么取样 浏览:18
美的反渗透滤芯怎么判断堵塞 浏览:481
饮水机为什么插电热水出凉水 浏览:812
cas水处理工艺 浏览:123
美的926s饮水机多少钱 浏览:190
小米净化器怎么取消手机连接 浏览:757
美的净水器反渗透滤芯怎么冲洗 浏览:300
途观汽油滤芯在哪里 浏览:437
反渗透保护液颜色为什么发黄 浏览:686
反渗透膜在线清洗装置 浏览:996
饮水机小飞虫怎么处理 浏览:30
反渗透双净水edi换了滤膜不制水 浏览:150
生活帮的净水器是什么牌的 浏览:440
布鲁雅尔空气净化器怎么清洗 浏览:759
重庆前沿水处理设备公司 浏览:965
养殖污水外排怎么处罚 浏览:383
超滤膜换滤芯 浏览:655
为什么污水泵电箱三个继电器 浏览:696