Extract Email Domain
beginnerCaptures just the domain portion from email addresses.
emaildomainextractionparsing
Pattern
/[\w.+-]+@([\w-]+(?:\.[\w-]+)+)/giTry 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
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /[\w.+-]+@([\w-]+(?:\.[\w-]+)+)/gi;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);