vb怎么过滤重复写入.txt的内容?
我的代码:DimurlDimmaDimstrAsString,mcAsMatchCollectionurl=WebBrowser1.LocationURLstr=GetT...
我的代码:
Dim url
Dim ma
Dim str As String, mc As MatchCollection
url = WebBrowser1.LocationURL
str = GetText(url)
Set mc = RegExpTest("\b[A-Za-z\d\.\_\-]{1,50}@[^.]+\.[A-Za-z\d]{2,4}\b", str)
Open "C:\tianyamail.txt" For Append As #1 'Append追加写入
For Each ma In mc
Print #1, ma.Value
Next
Close #1
比如:
72248756@qq.com;
72248756@qq.com;
72248756@qq.com;
72248756@qq.com;
643543543556@qq.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
369387500@qq.com;
369387500@qq.com;
sheng8214169@163.com;
我只想保留一个! 展开
Dim url
Dim ma
Dim str As String, mc As MatchCollection
url = WebBrowser1.LocationURL
str = GetText(url)
Set mc = RegExpTest("\b[A-Za-z\d\.\_\-]{1,50}@[^.]+\.[A-Za-z\d]{2,4}\b", str)
Open "C:\tianyamail.txt" For Append As #1 'Append追加写入
For Each ma In mc
Print #1, ma.Value
Next
Close #1
比如:
72248756@qq.com;
72248756@qq.com;
72248756@qq.com;
72248756@qq.com;
643543543556@qq.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
lsy21wangli@163.com;
369387500@qq.com;
369387500@qq.com;
sheng8214169@163.com;
我只想保留一个! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询