To support host patterns string should be properly escaped.