0

I'm trying to block certain domains from being accepted as an email.

I have looked online and found many answers but I cannot make them to work on my website

My current syntax is:

^(.+@)(?!domain_a|domain_b\.com)([A-Za-z0-9]+\.com)$

It works on a regex checker but fails on the site itself.

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
agora
  • 21
  • 5
  • See https://stackoverflow.com/questions/39636124/regular-expression-works-on-regex101-com-but-not-on-prod. If that does not help, add the code to the question. – Wiktor Stribiżew Jun 05 '20 at 09:48
  • Only accepting email addresses in the `.com` top-level domain is obviously infuriating for anyone in `.edu` or a country TLD. Many email providers use ccTLDs like `.io` and `.cc` just for coolness. Please don't proliferate this horrible antipattern. – tripleee Jun 06 '20 at 10:24

1 Answers1

0

Found the answer, maybe it is specific to the CMS, but the requirement was to add:

regexp=^/(.+@)(?!domain_a|domain_b.com)([A-Za-z0-9]+.com)$/^
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
agora
  • 21
  • 5