Do not compare hostnames to each other via regular expressions. Compare their downcased values, since hostnames are case-insensitive.