Take these four formats of the from parameter in an email’s header:
From: Jon Doe <jon.doe@a.validdomain.com>
From: "Jon Doe" <jon.doe@a.validdomain.com>
From: <jon.doe@a.validdomain.com>
From: jon.doe@a.validdomain.com
Has anybody made a regular expression that can match the email address to use in preg_match for these? I have tried a few but the < and > are catching them out
The regex you are looking for is
If you are looking to match just email it has been asked again and again… just search for regex email
Email validation which will include any email with a + sign or . in the email as well as the basics would look like