retrieve email adresses from txt file
-7
Retrieve email adresses from a given text file
Dim fso,textstr,contents
Set fso = createobject("scripting.filesystemobject")
set textstr = fso.OpenTextFile( InputBox("textfile to search in?"), 1,False)
contents = textstr.ReadAll
WScript.echo retrieveEmails(contents)
Function retrieveEmails(input)
Dim regexp,matches,match,output
set regexp = New regexp
regexp.pattern="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
regexp.ignorecase=True
regexp.global=True
set matches= regexp.Execute(input)
For Each match In matches
output & output & match.value & vbcrlf
Next
retrieveEmails = output
End Function
Comments
Voting
Votes Down
ASmith
bertheymans
bobbyrward
ctiggerf
i_kenneth
jbplou
Jo3y
Pio
Sonsam
vinmariani
wiz1705






Fix:
To: