If there is one that could handle this, then what is the correct regular expression pattern to extract email addresses from the line coming from the To email line, which allows you to separate addresses with commas ",", with a comma ";", spaces or any combination of the three. The regular expression should also be able to ignore the text "noise", for example, if the address is enclosed in "<" and ">", or has the actual name next to the email address. For example, from this line, which was in the To field:
"Joe Smith" <jsmith@example.com>, kjones@aol.com; someoneelse@nowhere.com mjane@gmail.com
The sample should be able to return the following matches: jsmith @example, kjones@aol.com , someoneelse@nowhere.com , mjane@gmail.com
I use PHP, so if this cannot be done in one regex then I will definitely open up for other PHP based solutions.
thank
source
share