I'm getting back a lot of returned emails (user unknown) from my maillist subscribers, so it's not a good idea to clean the database up by hand.
The returned emails are in a database (in just one big file) and I want to extract only the email part from following lines, no matter what His name is:
To: "His name" <xxxxx@foo.bar>
How can I find this since there is a lot of < and > and To: but is the only line that contains To:"His/her name"?
I end up nowere trying this:
open(FILE,"EmailFile"
;
while (<FILE>) {
if (/To:\"/ .. />/) { #match line markers
push(@lines,$_);
}
}
foreach $i (@lines) {
#what regex to put here??????
}
Thaks for any help
The returned emails are in a database (in just one big file) and I want to extract only the email part from following lines, no matter what His name is:
To: "His name" <xxxxx@foo.bar>
How can I find this since there is a lot of < and > and To: but is the only line that contains To:"His/her name"?
I end up nowere trying this:
open(FILE,"EmailFile"
while (<FILE>) {
if (/To:\"/ .. />/) { #match line markers
push(@lines,$_);
}
}
foreach $i (@lines) {
#what regex to put here??????
}
Thaks for any help