How to extract email address from a string using perl?

后端 未结 2 1446
南旧
南旧 2021-01-20 19:32

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 

        
相关标签:
2条回答
  • 2021-01-20 19:59

    Take a look at Email::Address or Email::AddressParser from cpan

     my @addrs = Email::Address->parse(
        q[me@local, Tony <me@local>, "Tony" <me@local>]
      );
    

    This returns a list of Email::Address objects it finds in the input string.

    0 讨论(0)
  • 2021-01-20 20:02

    Start with https://metacpan.org/pod/Email::Valid. It seems to work pretty well.

    0 讨论(0)
提交回复
热议问题