本帖最后由 apang 于 2014-2-10 00:11 编辑
以#3附件为例,有效邮箱地址1972个,用find或findstr会漏掉很多。- Set fso = CreateObject("Scripting.FileSystemObject")
- txt = fso.OpenTextFile("1.txt",1,false,-1).ReadAll
- Set re = New RegExp
- re.Pattern = "[\w\-\.]+@.+\.(com|cn|net)"
- re.IgnoreCase = True
- re.Global = True
- For Each m in re.Execute(txt)
- s = s & m & vbCrLf
- Next
- fso.OpenTextFile("2.txt",2,true).Write s
复制代码
|