Simple Email Address
beginnerBasic email validation matching user@domain.tld format.
emailvalidationforminput
Pattern
/[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}/giTry It
0 of 7 strings matched
Explanation
Matches a basic email address: one or more word characters, dots, plus signs, or hyphens before the @, followed by a domain name with at least one dot and a TLD of 2+ letters.
Test Strings
Matching
- user@example.com
- john.doe+tag@company.org
- test-123@sub.domain.co.uk
Non-matching
- @example.com
- user@
- user@.com
- plaintext
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Limited support (ASCII-only word boundaries) |
Code Snippets
const regex = /[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}/gi;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);Common Variations
Case-sensitive TLD
[\w.+-]+@[\w-]+\.[a-z]{2,}Only matches lowercase TLDs