in reply to scripty email address regex stuff

Do you want to parse the addresses or just extract them from the file? In the second case, why not just:
local $/ = undef; my $raw = <FILE>; $raw =~ s/[\r\n]//g; $raw =~ s/;\s+//g; my @list = split /;/, $raw;
and maybe:
foreach (@list) { s/^[^<>]+<([^<>]+)>$/$1/; # or: s/^[^<>]+<([^<>\s]+@[^<>\s]+)>$/$1/; }
but the second regex also throws away some legal addesses like "user!host1!host2!host3"

Search, Ask, Know

Replies are listed 'Best First'.
Re: Re: scripty email address regex stuff
by mkahn (Beadle) on Oct 16, 2003 at 15:50 UTC
    Did you actually try this
      Sed and uniq were really helpful for creating the final list