def match(self, string):
        """Returns True if the pattern matches the string"""
        if self.casesensitive:
            return fnmatch.fnmatch(string, self.pattern)
        else:
            return fnmatch.fnmatch(string.lower(), self.pattern.lower())
Returns True if the pattern matches the string