add kvpairs2td
[hband-tools.git] / user-tools / mail-extract-addresses
blob830075578a4122ef51cd9d07e3f450e0c34b4c27
1 #!/usr/bin/env perl
3 #use Data::Dumper;
5 while(<STDIN>)
7 chomp;
9 while(
10 /\s*,?\s*[^,]*?<([^\s\@""''<>,]+@[^\s\@""''<>,]+)>/m or
11 /\s*,?\s*[^,]*?([^\s\@""''<>,]+@[^\s\@""''<>,]+)/m or
12 /\s*,?\s*[""].*?[""]\s*<([^\s\@""''<>,]+@[^\s\@""''<>,]+)>/m or
13 /\s*,?\s*[''].*?['']\s*<([^\s\@""''<>,]+@[^\s\@""''<>,]+)>/m
16 #print STDERR Dumper {"before"=>$`,"match"=>$&,"address"=>$1,"after"=>$'};
17 print "$1\n";
18 $_ = $';