Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8139313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:47:11+00:00 2026-06-06T11:47:11+00:00

Take these four formats of the from parameter in an email’s header: From: Jon

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:47:13+00:00Added an answer on June 6, 2026 at 11:47 am

    The regex you are looking for is

    ^From:.*?<?(\S+@\S+?)>?\s*$  
    This will match the whole thing in any of the 4 cases
    

    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

    \b[!#\$%&'\*\+\-/=\?\^_`{\|}~a-zA-Z0-9][!#\$%&'\*\+\-/=\?\^_`{\|}~a-zA-Z0-9\.]*[!#\$%&'\*\+\-/=\?\^_`{\|}~a-zA-Z0-9]@[a-zA-Z0-9\-][a-zA-Z0-9\-\.]+[a-zA-Z0-9\-]\b
    This is what I use.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that currently has several methods that take integer parameters. These
Is there some way I can take text (retrieved from a form), and email
In an iOS app, I take a four digit code from the user and
Take these two classes for instance: struct Owned { Owned() : i() { }
In the math module, I could only find cos/sin/tan/acos/asin/atan. These take the argument, respectively
Is there anyway we can take input from command line in Objective-C, the way
Is there a way to take any number, from say, 1 to 40000 and
I want to take backup of jobs.I know all of these are stored in
This is more of a general question about the distinctions between these four different
How do I take four received data bytes and assemble them into a floating-point

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.