Vitaly Sinitsin wrote:
> How can I get the first email address from the following string:
> $str eq '[EMAIL PROTECTED];[EMAIL PROTECTED]';
> 
> I've got something like:
> $str =~ /^.*\@.*\.(\w{3}|\w{2,3}\.\w{2})$/
> but it retrieves only second email.

my $str = '[EMAIL PROTECTED];[EMAIL PROTECTED]';
$str =~ /^.*?([\w\.-]+\@[\w\.-]+)\b/;
my $email = $1;

-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to