Advertisement

02.08.2001 at 12:43AM PST, ID: 20074483
[x]
Attachment Details

pattern matching email address

Asked by onlygo in Perl Programming Language

Tags: email, perl, pattern, address, matching

Hi I need to read in an email (source with header), and extract the sender's name, or his email address if the name is not available. For example, these are possible "From: " lines in email headers:

From: abc@abc.com
From: <abc@abc.com>
From: ABC <abc@abc.com>
From: "ABC" <abc@abc.com>

For case 1 and 2, I need to extract the email address (since the name is not available), so it should return me abc@abc.com.

For case 3 and 4, I need to extract the name ABC.

Can anyone show me how to do this in Perl? I am really no good in regular expression and hope that you can help...Start Free Trial
[+][-]02.08.2001 at 06:06AM PST, ID: 5824122

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2001 at 08:29AM PST, ID: 5824493

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2001 at 09:50AM PST, ID: 5824777

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: email, perl, pattern, address, matching
Sign Up Now!
Solution Provided By: bebonham
Participating Experts: 4
Solution Grade: A
 
 
[+][-]02.08.2001 at 11:07AM PST, ID: 5825011

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2001 at 11:09AM PST, ID: 5825020

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2001 at 04:10PM PST, ID: 5825886

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2001 at 04:15PM PST, ID: 5825893

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.09.2001 at 07:37AM PST, ID: 5827948

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.09.2001 at 04:46PM PST, ID: 5829897

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32