Skip to main content
Regexflux

Email Excluding Free Providers

intermediate

Matches email addresses while excluding common free email providers like Gmail and Yahoo.

emailvalidationbusinesslookahead

Pattern

/[\w.+-]+@(?!(?:gmail|yahoo|hotmail|outlook|aol)\.)[\w-]+\.[a-zA-Z]{2,}/gi

Try It

0 of 5 strings matched

Explanation

Uses a negative lookahead after the @ to reject emails from common free providers (gmail, yahoo, hotmail, outlook, aol). Only business or custom domain emails pass.

Test Strings

Matching

  • ceo@company.com
  • dev@startup.io

Non-matching

  • user@gmail.com
  • person@yahoo.com
  • someone@hotmail.com

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GONot supported (RE2 engine)

Code Snippets

const regex = /[\w.+-]+@(?!(?:gmail|yahoo|hotmail|outlook|aol)\.)[\w-]+\.[a-zA-Z]{2,}/gi;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Common Variations

Extended block list

[\w.+-]+@(?!(?:gmail|yahoo|hotmail|outlook|aol|protonmail|icloud)\.)[\w-]+\.[a-zA-Z]{2,}

Also blocks protonmail and icloud

Related Patterns