Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Email Address from Question Library: Factoring in sub-domains

I have been using this handy feature for the last few years now.

In recent times, I have come across a domain or two that has not been factored in to the email validator tool. So I simply add it in.

In discussions with my IT colleague recently, he informs me of hundreds of sub-domains now appearing.

He just gave me a list of 300-400 sub-domains.

I'm just wondering how can I continue to use the Email Address tool from the Question Library that has served me so well in recent years?

Does it need an update to take these sub-domains into account?

Below is a small sample of sub-domains ...

•    .melbourne
•    .study
•    .style
•    .supplies
•    .supply
•    .support
•    .surgery
•    .sydney
•    .systems
asked May 31, 2020 by Paul Moon Platinum (99,340 points)

1 Answer

0 votes
This is the eternal dilemma of trying to determine whether a given email is likely valid.  If you use a highly-specific regular expression, you get false negatives when a new top-level domain is introduced.  If you use a more generic regular expression, you risk false positives.  Your best option for this probably boils down to which of those risks you are more comfortable with.

If you look at the regular expression in the Community Question Library, you should see the top-level domains that it already supports:


If you want to keep this regular expression fairly specific, you could add your new top-level domains to this list.

But it sounds like you have a lot of domains in mind.  Perhaps this warrants making the regular expression more forgiving.  Near the end of the current regex's domains, you should see this:


That allows for any two-letter top-level domain to get through.  That could be replaced with something like this to allow for any top-level domain that is two or more letters:

answered Jun 1, 2020 by Zachary Platinum Sawtooth Software, Inc. (207,200 points)
Thanks Zachary. You're a good man.

I'm not into applying strict rules.

I prefer guidance more than anything.

So I will test your "not so strict approach" out.

I will conduct the test tomorrow. I'll let you know how it goes.

Onya mate.
Just touching base once again Zachary. I gave that email validator a tweak to allow those sub-domain examples to flow through.

OK, we've loosened the rules a little here, but these type of emails can now go through. I would also like to think the respondent can get their email right.

Thanks again buddy. Much appreciated.