Hi I need regular expression for Email with custom domain only, means I want to exclude:
@live, @hotmail, @outlook, @aol, @yahoo, @rocketmail, @gmail, @gmx.com, @mail.com, @inbox.com, @icloud, @aim, @yandex, @zoho
Use two regex tests for your candidate strings in a single loop.
In the first test, you check for the unwanted domains and skip the string if you get a match:
/^[\w-\._\+%]+@(live|hotmail|outlook|aol|yahoo|rocketmail|gmail|gmx\.com|mail.com|inbox.com|icloud|aim|yandex|zoho)\./
In the second test, you use your standard email regex.
Add the following immediately after the @ in your email address pattern:
(?!(?:live|hotmail|outlook|aol|yahoo|rocketmail|gmail|
gmx\.com|mail\.com|inbox\.com|icloud|aim|yandex|zoho)$)
Be sure to use a case-insensitive match.
(Line break added for readability.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With