John Edwards wrote:
>
> You can use the following code...
>
> $email = 'Name LastName <[EMAIL PROTECTED]>';
> $email =~ /<([\w@.]+)>/;
> $email = $1;
> print $email;
What about this valid e-mail address <[EMAIL PROTECTED]>? What if
$1 is set from a previous match and this match fails?
John
"Jonathan E. Paton" wrote:
>
> --- Roman Fordinal <[EMAIL PROTECTED]> wrote:
> >
> > I need to get the email address from string:
> >
> > $email="Name LastName <[EMAIL PROTECTED]>"
> >
> > How do I extract it? [Above converted to English -
> JEP]
>
> ($email = $email ) =~ /\<([^>]+)\>$/;
> -Original Message-
> From: John Edwards [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 9:25 AM
> To: 'Jonathan E. Paton'; [EMAIL PROTECTED]
> Subject: RE: select text
>
>
> "Give a man a fish and you feed him for a day.
>
ow how...
John
-Original Message-
From: Jonathan E. Paton [mailto:[EMAIL PROTECTED]]
Sent: 05 February 2002 17:19
To: [EMAIL PROTECTED]
Subject: Re: select text
--- Roman Fordinal <[EMAIL PROTECTED]> wrote:
>
> I need to get the email address from string:
>
> $email
You can use the following code...
$email = 'Name LastName <[EMAIL PROTECTED]>';
$email =~ /<([\w@.]+)>/;
$email = $1;
print $email;
As you seem relatively new to this, here is a breakdown
$email = 'Name LastName <[EMAIL PROTECTED]>';
# Just define the data for this demo
$email =~ /<([\w@.]+)>/
--- Roman Fordinal <[EMAIL PROTECTED]> wrote:
>
> I need to get the email address from string:
>
> $email="Name LastName <[EMAIL PROTECTED]>"
>
> How do I extract it? [Above converted to English -
JEP]
($email = $email ) =~ /\<([^>]+)\>$/;
Jonathan Paton
___