Jump to content

Retrieving Email Addresses from text file


Prakhar
 Share

Recommended Posts

Hi everyone , i want an algorithm which can fetch email addresses from normal text file. Eg. A@an.com from text file t.txt which contains - hi brother A@an.com is my email address is THANKS IN ADVANCE

[size="5"]"No Pain, No Gain"[/size]

Link to comment
Share on other sites

#Include <Array.au3>

$text = 'hi brother [email="A@an.com"]A@an.com[/email] is my email address'
$Pattern = "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}"

$a = StringRegExp($text, $pattern, 3)

_ArrayDisplay($a)

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
Share on other sites

Sorry, it didn't worked ,but thanks. I want to fetch all the addresses in the file attached, the file will contain some texts (Like an example of iTunes I've shown in file), the text will not be static it will change now and then.The algorithm should find email address by following expressions :-

@

@@

(@)

<@>

.@.

.at.

(at)

_at_

@at@

\'at\'

\"at\"

(atsign)

(at_sign)

(at-sign)

(at sign)

[size="5"]"No Pain, No Gain"[/size]

Link to comment
Share on other sites

Sample of file- Kindltientlinkinemd.gjg.jmdmjtag.mgjmdgmtkgjt.jgkgjgjagjgjhjgjt Mike -mike@gmail.co.in

Tom :Tommy<atsign>domain.com

WeaponX| W.X(@)gmail.com

Gates\gates.at.home.com

Tommy # tom.cool'at'hotmail

jg.wmgj.jagmp.ja.mwgtpgmgjt gmpw.jmwjm.jt.gmtmtdmjgmjtjtmt g.jtpg.mtjmtjgmdj.tgdmjtgmgt.mdjtg

[size="5"]"No Pain, No Gain"[/size]

Link to comment
Share on other sites

WeaponX| W.X(@)gmail.com

People obfuscate their email addresses like that for a reason... and where exactly did the file come from?

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...