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 firstname.lastname@example.org <mailto:email@example.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. :)