There's more than one way to do things | |
PerlMonks |
Shuckin' the Email Addyby Anonymous Monk |
on Sep 07, 2000 at 06:10 UTC ( [id://31353]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've got some mailing lists in this format:
EMAIL user@somedomain.com *OR* EMAIL user@somedomain.com <mailto:user@somedomain.com> What I am working on is a bit of code to pull a clean email address out of either format and store it in a scalar (or perhaps two scalars.... one for the username and one for the domain). (The formats are mixed up within the mailing list file.) Is there a simple regexp to do this? Can someone help me? :) (I can handle the code for looping through each line of the file. But I am stumped as to the precise regexp I need to use to extract the email address and whether or not I need to use split() or simply s/// or perhaps m// to do the trick.) Perhaps there is more than one way to do it. :)
Back to
Seekers of Perl Wisdom
|
|