Best way to parse string of email addresses

后端 未结 13 2611
悲哀的现实
悲哀的现实 2021-02-14 04:10

So i am working with some email header data, and for the to:, from:, cc:, and bcc: fields the email address(es) can be expressed in a number of different ways:

F         


        
13条回答
  •  深忆病人
    2021-02-14 04:57

    I use the following regular expression in Java to get email string from RFC-compliant email address:

    [A-Za-z0-9]+[A-Za-z0-9._-]+@[A-Za-z0-9]+[A-Za-z0-9._-]+[.][A-Za-z0-9]{2,3}
    

提交回复
热议问题