validation

Email Address Regex Pattern

Practical email regex that catches 99% of valid addresses. Not RFC 5322 exhaustive (that pattern is 6,000+ characters). This one validates 'anything-then-@-then-anything-then-dot-then-anything' with no spaces.

/^[^\s@]+@[^\s@]+\.[^\s@]+$/

What each part matches

^[^\s@]+ — one or more chars that aren't whitespace or @
@ — literal at sign
[^\s@]+ — one or more chars that aren't whitespace or @ (domain part)
\. — literal dot (escaped)
[^\s@]+$ — TLD, one or more non-space non-@ characters

✓ These match

✗ These don't

  • not-an-email
  • user@
  • @example.com
  • user @example.com

Use in your code

JavaScript

const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
re.test(input); // → true or false

Python

import re
re.fullmatch(r"^[^\s@]+@[^\s@]+\.[^\s@]+$", input)

PHP (PCRE)

preg_match('/^[^\s@]+@[^\s@]+\.[^\s@]+$/', $input);

Go

re := regexp.MustCompile(`^[^\s@]+@[^\s@]+\.[^\s@]+$`)
re.MatchString(input)

FAQ

Does this email address regex work in JavaScript?
Yes. Every pattern in the Utilko regex library is tested to work in JavaScript RegExp, PCRE (PHP, Nginx), and Python `re`. Where flavor matters (lookbehind, named groups), the pattern page flags it.
How do I use this pattern?
Copy the pattern from the code block above. In JavaScript: new RegExp('^[^\s@]+@[^\s@]+\.[^\s@]+$') or literal /^[^\s@]+@[^\s@]+\.[^\s@]+$/. Or click "Try in regex tester" to open it pre-loaded in Utilko's browser-based regex tester.
Should I use this for security-critical validation?
Client-side regex is fine for UX (immediate feedback on a form). For anything security-critical — payments, auth, data integrity — always re-validate server-side using the same pattern PLUS domain-specific checks (Luhn checksum for cards, actual email delivery test, DNS resolution for domains).

Related regex patterns

← All regex patterns · Regex tester · Regex cheat sheet