<%
hehe = hello(“ http://mmsg.qq.com/cgi-bin/gddylist?type=13&sort = 1&page = 3”,“ <html>”,“ </html>”,“ </html>” 35%“” bgcolor =“”#[/dabcde] {6}”“>(。*)
wress.writehehe
FunctionHello(Strurl,Strstart,Strend,Patrn,deppstr)
str = getbody(strurl)
str = mymid(str,strstart,strend)
str =替换(patrn,replstr,str)
你好= str
最终功能
函数amid(Str,strstart,strend)
ifstrstart =“”然后
i = 0
别的
i = instr(str,strstart)
Endif
Ifstrend =“”然后
j = len(str)
别的
j = inser(i,str,strend)
Endif
mymid = mid(str,i,j-i+1)
最终功能
FunctionReplaceTest(Patrn,replstr,str1)
Dimregex,比赛,匹配
setRegex = newregexp
REGEX.PATTERN = PATRN
Regex.ignorecase = true
REGEX.GLOBAL = TRUE
setMatches = regex.execute(str1)
foreachMatchinMatches
替换=替换替代®Ex.ex.replace(Match.Value,replstr)
下一个
最终功能
functiongoby(url)
setObjxml = createObject(“ Microsoft.xmlhttp”)
with objxml
.open“ get”,url,false,“”,“”
。发送
getbody = .Responsebody
端
getbody = bytestobstr(getbody,“ gb2312”)
setObjxml =没有
最终功能
functionbyTestObstr(strbody,codebase)
setObjstream = server.createobject(“ adodb.stream”)
withobjstream
.type = 1
.mode = 3
。打开
.writestbody
.position = 0
.type = 2
.charset =代码库
bytestobstr = .ReadText
。关闭
端
setObjstream =没有
最终功能
%>
其他调用示例:
hehe=Hello("http://list.mp3.baidu.com/song/A.htm","<tablewidth=""90%""border=""0""align=""center""cellpadding=""3""cellspacing=""0""bgcolor=""#f5f5f5"">" ,“ <divalign =中心>”,“。