Disposable / Temporary Email Domain Detection Regex for JavaScript
/@(?:mailinator|guerrillamail|tempmail|throwam|yopmail|maildrop|sharklasers|guerrillamailblock|grr|spam4|trashmail|dispostable|spamgourmet|10minutemail|tempinbox|mailnull|spambog|getairmail|getnada|spam\.la|mailexpire)\.(?:com|net|org|me|io)$/iWhat this pattern does
This page provides a comprehensive, battle-tested regular expression for matching disposable / temporary email domain detection, ported and verified for JavaScript. Identity and credential patterns need both correctness and safety, since they're frequent targets for adversarial input. The snippet below is ready to drop into your JavaScript project — whether you're validating in an Express middleware, a Next.js API route, or a client-side form.
Javascript Implementation
// Disposable / Temporary Email Domain Detection
// ReDoS-safe | RegexVault — Identity & PII > Email Address
const disposableTemporaryEmailDomainDetectionRegex = /@(?:mailinator|guerrillamail|tempmail|throwam|yopmail|maildrop|sharklasers|guerrillamailblock|grr|spam4|trashmail|dispostable|spamgourmet|10minutemail|tempinbox|mailnull|spambog|getairmail|getnada|spam\.la|mailexpire)\.(?:com|net|org|me|io)$/i;
function validateDisposableTemporaryEmailDomainDetection(input: string): boolean {
return disposableTemporaryEmailDomainDetectionRegex.test(input);
}
// Example
console.log(validateDisposableTemporaryEmailDomainDetection("test@mailinator.com")); // trueTest Cases
Matches (Valid) | Rejects (Invalid) |
|---|---|
test@mailinator.com | user@gmail.com |
user@guerrillamail.com | user@example.com |
abc@yopmail.com | user@outlook.com |
x@tempmail.com | — |
When to use this pattern
This pattern is drawn from the Identity & PII > Email Address category and carries a ReDoS-safe certification. That matters for JavaScript developers because especially critical in long-running Node.js event loops where a ReDoS vulnerability can block the entire process. RegexVault audits patterns against known backtracking attack vectors, ensuring you have the necessary context before using this regex in a high-stakes production environment.
Common Pitfalls
Some legitimate use cases exist for disposable emails (e.g., security researchers testing). A blocklist approach is more maintainable than regex — regex is only suitable for a fixed set of known domains.
Technical Notes
This is a partial list — the disposable email ecosystem changes constantly. Use a maintained blocklist (e.g., disposable-email-domains GitHub repo) rather than a static regex. New domains appear regularly.
Have a pattern that belongs in the vault?
Submit it for review — community-verified patterns get credited to your GitHub handle. Free submissions join the queue. Priority review available for $15.
Submit a Pattern