Finding out if a given email address falls under blacklisted item

I am developing a system where I have a textarea where I can add

  1. email address (Eg:
  2. domain name (Eg:
  3. subdomain name (Eg:
  4. wildcard (an astix *)

These items can either be separated by comma (,) or each item in a new line. These items will act as a list of blacklisted items. A user trying to signup using any of the above should not be allowed to signup. Here is how the system should behave:

  1. will block

  2. will block {any_username} and also {any_username}@{any_subdomain}

  3. will only block {any_username}

  4. * will block {any_username}@{any_domain} and also {any_username}@{any_subdomain}.{any_domain}

I am struggling to write a logic that could prevent a user to signup using the above logic.

Can someone please help?

what code have you made to try this on your own? maybe a translation to regex will help you. using regex as input format would be easy to verify and expand.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.