I want a solution to validate only domain names not full urls, The following example is what i\'m looking for:
domain.com -> true
domain.net -> true
do
Please try this expression:
^(http[s]?\:\/\/)?((\w+)\.)?(([\w-]+)?)(\.[\w-]+){1,2}$