Updated haswildcard() to perform a single test