I would like to parse a mailer to-string which could consist of the following examples separated with a comma (,):
First name <email@example.com>
"first name" <email@example.com>
<email@example.com>
email@example.com
I would like to make an array with an entry for each element with two sub-entries: [name] and [email].
I’ve been struggling with the regexp for (what looks like) ages. Could someone help me?
If you have the imap extension enabled, it may be as simple as:
Output: