Company email addresses only
Signup validation that rejects free webmail domains
See input + output preview
Input
- What should the pattern match?
- Email addresses on the company domains acme.com and acme.co.uk, case-insensitive. Reject everything else, including gmail and addresses with nothing before the @.
- Regex flavor
- JavaScript / TypeScript
- Examples that must match (one per line)
- [email protected] [email protected]
- Examples that must not match (one per line)
- [email protected] @acme.com
- Strictness
- Practical (readable, covers common cases)
Output (excerpt)
```javascript /^[a-z0-9._%+-]+@acme\.(?:com|co\.uk)$/i ``` **Flags:** `i` — domains and local parts are compared case-insensitively. | Token | Meaning | |---|---| | `^` … `$` | the whole string must be the address | | `[a-z0-9._%+-]+` | local part: one or more letters, digits or the common punctuation | | `@acme\.` | literal @acme. — the dot is escaped | | `(?:com\|co\.uk)` | exactly one of the two company domains | | Input | Expected | Why | |---|---|---| | `[email protected]` | match | plain local part, allowed domain | | `[email protected]` | match | dot in local part, second domain | | `[email protected]` | no match | domain not in the list | | `@acme.com` | no match | empty local part | | `[email protected]` | no match | anchored, nothing may follow |…