<%
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 =中心>”,“。