Checkname=True
Dim Rep,pass
Set Rep=New RegExp ' 建立正则表达式。
Rep.Global=True '设置全局可用性。
Rep.IgnoreCase=True'设置是否区分字符大小写
'设置模式。
Rep.Pattern="[u0009u0020u0022-u0028u002C-u002Eu003A-u003Fu005Bu005Cu0060u007Cu007Eu00FFuE5E5]"
Set pass=Rep.Execute(Str) '对指定的字符串执行正则表达式搜索。
If pass.count<>0 Then CheckName=False
'response.Write(Checkname)
'response.End()
Set Rep=Nothing
End Function
index.asp,asp代码部分
if Request.QueryString("id")="" thenresponse.write"<SCRIPT language=JavaScript>alert('ID错误!')"
response.write"javascript:history.go(-1)</SCRIPT>"
else
id= Request.QueryString("id")
url = "http://www.ceshi.com/"&id&".html"
dim a,b
a=GetPage(url)
b=GetContent(a,"url=""","html",0)&"html"
'urlb = "http://www.ceshi.com/2015/06/28/123456.html"
'要求:21.html中格式为url="XXX.XX"前缀url=,后面是双引号
'还是有些不明白,生成html的时候地址直接写进数据库不好么,
'文章表对应ID 存储html地址这样
urlb=b
end if
ComStrindex = GetPage(urlb)
Set Re=new RegExp
Re.Global = True
listbody = GetContent(ComStrindex,"<!DOCTYPE","</html>",1)
set reg = new regexp
reg.global = true
reg.ignorecase = true
reg.pattern = "包含内容:""(.*?)"""
set baohan = reg.execute(listbody)