0

I'm using Zurb Foundation and I'm trying to make custom combo email/domain name validation using abide validation. On a registration form i need to validate 2 input fields (Email and website Url), the email address must match with the domain suffix. and contemporary block common public domains emails account (google, yahoo, msn etc) from registering.

enter image description here

lincolnpixel
  • 109
  • 1

1 Answers1

0

Regex isn't the tool for this, you should have a config file containing the "banned" domains and then scan through that list. This way you can change the list without needing to change your website code.

Even once you move past that though you should read this question and the answers which explains why regex validation of email addresses is very hard: Using a regular expression to validate an email address

Community
  • 1
  • 1
Tim B
  • 40,716
  • 16
  • 83
  • 128