fnmatch function replacement