I'm receiving content such as:
"Jane Doe" <jane@doe.com>, "John Doe" <john@doe.com>
And I would like to extract the email addresses:
jane@doe.com, john@doe.com
Currently I have a regex like this:
/<(.*)>/
Which gets everything in between brackets, but it also gets things like:
jane@doe.com>, "John Doe" <john@doe.com
When I used an @ sign in the middle, it also didn't work quite right:
/<(.*)@(.*)>/
I could explode()
based on the comma, but I'm thinking there ought to be a way for preg_match()
to give me what I want. What am I missing in my regex?