Search code examples
regexmodx

Regex to exclude list of domain in an email field not working


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.


Solution

  • 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)$/^