I am trying to put together a regex to search for specific emails in the To: section of an email header. I have several email addresses, any one of which can be in the To: section of the header. There may be one or several of the specific addresses and there must be a match if there are one or more of the addresses.
I have this as a start.
The email header may contain the following examples in any combination depending on the senders requirements, however I only need to trigger on the first match of the specific addresses. Based on the regex finding the match, I will trigger other processes. There also may be other extraneous email addresses which I expect will be ignored based on the criteria.
To: email@example.com, firstname.lastname@example.org
To: email@example.com, firstname.lastname@example.org, email@example.com
To: firstname.lastname@example.org, email@example.com
I have hit a wall as I am no expert at Regex.
Any help would be appreciated.