Domain Name Match Regex. You can match and with out Remembering the match as well. Case sensitive regex to verify if a string is a valid domain name.
Unit Test with jUnit. Given string str the task is to check whether the given string is a valid domain name or not by using Regular Expression. This allows to match any character in any language.
Case insensitive Regex flavors.
Unit Test with jUnit. The valid domain name must satisfy the following conditions. Unit Test with jUnit. As for legal dns hostname provided that you are checking for internet hostnames only and not intranet I wrote the following snipped a mix of shellphp but it should be applicable as any regular expression.