Parsing a free-rorm field looking for an email address

Kenneth Brody kenbrody at bestweb.net
Thu Jan 26 17:47:45 PST 2006


Quoting Mike Schwartz (PC Support & Services, Appleton, WI) (Thu, 26 Jan
2006 18:44:00 -0600 (CST)):
[...]
> >>      Does anybody have a routine that parses a
> >> free-form line looking for
> >> an email address in it?  I thought somebody posted a
> >> routine that did
> >> this a while ago.
[...]
>  Yes, I found that edit posted by Peter Klaassen on 2/14/2001.
>
> One of the guys I'm working with found some perl code that seems to
> do a good job of extracting the emsail addresses, so I think I'm
> going to pipe my data out through that and see what happens.

Assuming the edit was basically:  left_part "@" right_part
you could brute-force it on any string which contains "@" by taking
the left side and stripping the first character until it passes the
left_part edit, and then taking the right side and stripping the
last character until it passes the right_part edit.  (Or, you could
take the opposite approach, and keep prepending characters to the
left side until it fails, and back up one, and repeat with the
right side.)

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list