The WildHostMatcher escapes a number of characters before interpreting it as a regex. It should also escape square brackets, or else the regex will be misinterpreted.
For example, [foo.com]:2222 will be interpreted as the regex "match any of characters f, o, o... once" instead of the string "foo.com".
You may also want to assert that the regex contains the whole string, by anchoring the start and the end. Something like this instead:
Pattern pat = Pattern.compile("^" + hostEntry.replace(".", "\\.").replace("*", ".*").replace("?", ".")) + "$")