DevTools
Back to Regex Tester

Email Address Regex Pattern

Learn how to validate email addresses using regex. Copy-paste ready pattern with examples and test cases.

The Pattern

/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g

How It Works

TokenMeaning
[a-zA-Z0-9._%+-]+One or more letters, digits, dots, underscores, percent signs, plus signs, or hyphens (local part)
@Literal @ symbol
[a-zA-Z0-9.-]+One or more letters, digits, dots, or hyphens (domain name)
\.Literal dot separator
[a-zA-Z]{2,}Two or more letters (TLD like .com, .org)

Test Cases

user@example.comMatch
john.doe+work@company.co.ukMatch
name_123@test.orgMatch
invalid@No match
@nodomain.comNo match
name@domain.cNo match

Code Examples

javascript
const emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
const text = "Contact us at hello@example.com or support@test.co.uk";
const matches = text.match(emailRegex);
console.log(matches); // ["hello@example.com", "support@test.co.uk"]
python
import re
email_regex = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
text = "Contact us at hello@example.com or support@test.co.uk"
matches = re.findall(email_regex, text)
print(matches)  # ['hello@example.com', 'support@test.co.uk']

Common Use Cases

Related Patterns

Want to test this pattern with your own data?

Try this pattern in Regex Tester →