VBS- 'VBS用正则表达式提取网址
- 'CODE BY Broly
- Dim fso,re,f,txt,objm
- Set fso=CreateObject("Scripting.Filesystemobject")
- Set re=New RegExp
- re.Global=True
- re.IgnoreCase=True
- re.Pattern="http://www\.jddl\.net/hm/download/gif/chip/c/\w+.\w+"
- For i=1 To 2
- Set f=fso.OpenTextFile("download("&i&").txt",1,false)
- Set objm=re.Execute(f.ReadAll)
- For Each ma In objm
- s=ma.Value & Chr(13) & Chr(10) & s
- Next
- f.Close
- Next
- Set txt=fso.CreateTextFile("url.txt",true)
- txt.WriteLine(s)
- txt.Close
- WScript.Echo "已保存为url.txt" '此行可以删了
复制代码
|