Re: Regular expression
| From: | Aidan Lister | Date: | Wed, 23 Jun 2004 09:41:19 +0000 |
| Subject: | Re: Regular expression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189280@lists.php.net to get a copy of this message | ||
I suggest not using a regex.
There are better tools for parsing an email, for example "formail".
$email =
formail -x Return-Path;
See google.com for more information
Regards,
Aidan
"Syed Ghouse" <syed@jinis.com> wrote in message
news:00d701c45e83$9a662a50$495aa8c0@jinis.com...
Hi All
will anyone give me a solution to get the name and email address of sender
from the mail text below using regular expression.
The result shud get
name as syed ghouse
and
email as syed@jinis.com
--- Mail text start ---
Return-Path: <avijayanand@sdmimd.com>
Delivered-To: syed@sdmimd.com
Received: (qmail 25523 invoked by uid 508); 19 Jun 2004 06:23:25 -0000
Received: from localhost (HELO 192.168.90.8) (127.0.0.1)
by mail.jinis.com with SMTP; 19 Jun 2004 06:23:25 -0000
Received: from 192.168.90.20 (proxying for 192.168.90.85)
(SquirrelMail authenticated user vijayanand@sdmimd.com)
by 192.168.90.8 with HTTP;
Sat, 19 Jun 2004 11:53:25 +0530 (IST)
Message-ID: <4875.192.168.90.20.1087626205.squirrel@192.168.90.8>
Date: Sat, 19 Jun 2004 11:53:25 +0530 (IST)
Subject: test
From : 'syed ghouse' <syed@jinis.com>
To: vijayanand@sdmimd.com
Cc: syed@sdmimd.com,sss@sdmimd.com
User-Agent: SquirrelMail/1.4.2
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3
Importance: Normal
test mail ignore
--- Mail text end ---
Regards
Syed