In Node.js, how can I check if a domain issued by the user is possible and contains allowed characters only?
I do not want to check if the actual domain is existent, only that it is syntactically correct.
Eg. something.something.something should be allowed, where "*)()-.net shouldn't.
I have tried to use some of the regexs on the question How to validate domain name in PHP? however, I'm actually unsure of how to use these in node. They seemed to always come out false.