in reply to Grabbing e-mail addresses from a variable

No that will only get the first one. You want something more like:

my @addrs = ($data =~ /mailto:(.+?\@[^">\s]+)"?/g);
(Only tested with very limited cases). But my vote would be to use HTML::LinkExtor in preference to some regex which is bound to fail under some circumstance.

/J\

Replies are listed 'Best First'.
Re: Re: Grabbing e-mail addresses from a variable
by Anonymous Monk on Jun 20, 2003 at 11:34 UTC
    Thanks, that works.
Re: Re: Grabbing e-mail addresses from a variable
by nite_man (Deacon) on Jun 20, 2003 at 13:19 UTC
    I would like to notice that if after email address will be some character unlike from space - dot, comma, semicolon etc, than this character will be included into result.
          
    --------------------------------
    SV* sv_bless(SV* sv, HV* stash);