Regex for Email Address
Matches standard email addresses with common TLDs. Covers most real-world email formats used in web forms and validation.
Pattern
/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/Pattern Breakdown
| Token | Explanation |
|---|---|
| ^ | Start of string |
| [a-zA-Z0-9._%+-]+ | One or more allowed characters in the local part (letters, digits, dots, underscores, percent, plus, hyphen) |
| @ | Literal @ symbol separating local and domain parts |
| [a-zA-Z0-9.-]+ | Domain name (letters, digits, dots, hyphens) |
| \. | Literal dot before TLD |
| [a-zA-Z]{2,} | Top-level domain with 2 or more letters |
| $ | End of string |
Test Examples
| Input | Match? |
|---|---|
| user@example.com | Match |
| first.last@company.co.uk | Match |
| user+tag@gmail.com | Match |
| invalid@ | No match |
| @nodomain.com | No match |
| spaces in@email.com | No match |
Common Use Cases
- Form validation
- Contact form input checking
- Email parsing from text
- User registration validation
Variations
^[\w.+-]+@[\w-]+\.[\w.]+$Shorter version using \w shorthand
^.+@.+\..+$Minimal check (has @ and dot)
Other Regex Patterns
Want to test this pattern with your own data?
Open the Regex Tester