reimpl for wildcard matching