广州明生医药有限公司


正则表达式检查来访IP是否合法的实际应用

网络编程 正则表达式检查来访IP是否合法的实际应用 06-22
正则表达式检查来访IP是否合法的实际应用


sub chkIP(boardid)
dim rsIP
dim ipArr
dim ignored
dim i
dim ip
dim sql
ip=Request.ServerVariables("REMOTE_ADDR")
ignored=false
if not isempty(boardid) then
sql="select ignoreip from board where boardid="&cstr(boardid)
set rsIP=conn.execute(sql)
if not (rsIP.eof and rsIP.bof) then
if instr(cstr(rsIP("ignoreip")&""),chr(13)&chr(10)) then
iparr=split(rsIP("ignoreip"),chr(13)&chr(10))
for i=0 to ubound(iparr)
if trim(iparr(i))<>"" and left(ip,len(trim(iparr(i))))=trim(iparr(i)) then
ignored=true
exit for
end if
next
else
iparr=rsIP("ignoreip")
if ip=trim(iparr) then
ignored=true
end if
end if
end if
rsIP.close
end if
if ignored then
response.write "<script language=javascript>window.location.href='ignoreip.htm'</script>"
end if
end sub

正则表达式简单的检查输入email是否合法程序
functionchkEmail(email)onerrorresumenextdimi,l,pos1,pos2chkEmail=trueifisnull(email)thenchkEmail=false:exitfunctionpos1=instr(email,"@")pos2=instrRev(email,".")ifnot(pos10)ornot(pos20)orpos1pos2thench

VBscript 的正则表达式 字符串匹配
由于我对正则不是很清楚,我想求取把字符串str,DGK,rDJK,DJKl,DGK,end替换为str,MSN,rDJK,DJKl,MSN,end求匹配式的写法。[Ctrl+A全选注:如需引入外部Js需刷新才能执

比较不错的C#中的常用的正则表达式
为了能够更好地理解如何在C#环境中使用正则表达式,我写出一些对你来说可能有用的正则表达式,这些表达式在其他的环境中都被使用过,希望能够


编辑:广州明生医药有限公司

标签:正则表达式,字符串,是否合法,我想,环境