How to extract emails address from a string using perl and to put the email addres into a variable? My strings looks like
Ben Tailor <bentaylor@gmail.com>
barbara@gmail.com, barbara2@gmail.com, Ben Tailor <bentaylor@gmail.com>
I tryed this
$string ="Ben Tailor <bentaylor@gmail.com>";
$string =~ /\b([^\s]+@[^\s]+)\b/g ;
print $string;
And the Out put xas:
Ben Tailor <bentaylor@gmail.com>
Someone have an Idea?
Fixed using
Email::Valid->address($string);
Thx