Skip to main content
Regexflux

Extract Email Domain

beginner

Captures just the domain portion from email addresses.

emaildomainextractionparsing

Pattern

/[\w.+-]+@([\w-]+(?:\.[\w-]+)+)/gi

Try It

0 of 5 strings matched

Explanation

Matches a full email address but captures only the domain portion (everything after @) in group 1. Useful for extracting domains from email lists.

Test Strings

Matching

  • user@example.com
  • admin@sub.domain.co.uk

Non-matching

  • user@
  • @example
  • no-email-here

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /[\w.+-]+@([\w-]+(?:\.[\w-]+)+)/gi;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns