Try the Email::Find module, prehaps.
update:
You say you are writing an auto-responder,
and thus I think you won't need to search for an
email adresses in completely arbitrary text. In that case
Mail::Address and (possibly) Mail::Header and Email::Valid should be enough to
(probably more easily and reliabily) do
what you need.
| [reply] |
| [reply] |
If you want completely accurate results--and want to understand them--please get a copy of Mastering Regular Expressions. The code is online, but the commentary--and difficulties--associated with validating email addresses are presented very clearly.
It's not a trivial process and the discussion leading up to it is worth the purchase price, for it applies to Perl and many other products as well.
YMMV, of course...
--f
| [reply] |
I have seen many times that there is no *easy* way to write a regex to match the full specification for an email address. I do know there is at least one module on CPAN that does validation, it might be a place to start.
update: try this node for starters.
| [reply] |
Plenty of good advice already appears above. For the sake of
completeness, though, I thought I would note that there is
another module, Mail::CheckUser, that is also available. This
nifty little module will even make sure that a mail server
exists and attempt to verify the user's existence on that
server. You can run any subset of the module's checking
routines that you wish. See the module docs
for more info, including important warnings.
-HZ | [reply] |