- '//把次vbs跟HTM文件放在一起运行
- Dim fso,fc,f,colMatches,match,re
- Set re=New RegExp
- re.Global=True
- re.IgnoreCase=True
- re.Pattern="[0-9]+"">(\w*|[\u4e00-\u9fa5]*|\w*[\u4e00-\u9fa5]*.*)</a>"
- Set fso=CreateObject("Scripting.FileSystemObject")
- Set fc=fso.GetFolder(".").Files
- For Each f In fc
- If fso.GetExtensionName(f)="htm" Then
- str=fso.OpenTextFile(f,1).ReadAll:fso.OpenTextFile(f,1).Close
- Set colMatches=re.Execute(str)
- For Each match In colMatches
- txt=txt & re.Replace(match.Value,"$1") & vbcrlf
- Next
- End If
- Next
- Set f=fso.CreateTextFile(fso.GetFolder(".")&"\String.txt",True)
- f.Write txt
- f.Close
- MsgBox "保存在当前目录String.txt中",vbOKOnly+vbInformation,"提醒:"
复制代码
|