Skip to main content
Regexflux

Email with Display Name

intermediate

Matches email addresses with optional display name like 'John Doe <john@example.com>'.

emailvalidationparsingdisplay-name

Pattern

/(?:([\w\s]+)\s+)?<?([\w.+-]+@[\w-]+\.[a-zA-Z]{2,})>?/g

Try It

0 of 6 strings matched

Explanation

Optionally captures a display name (word characters and spaces) followed by an email address that may be enclosed in angle brackets. Group 1 captures the display name, group 2 captures the email.

Test Strings

Matching

  • John Doe <john@example.com>
  • jane@example.org
  • Support Team <support@company.com>

Non-matching

  • <>
  • John Doe
  • < >

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /(?:([\w\s]+)\s+)?<?([\w.+-]+@[\w-]+\.[a-zA-Z]{2,})>?/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns