docs: def match(self, p_todo):
          """
          Performs a match on a key:value tag in the todo.
  
          First it tries to convert the value and the user-entered expression to
          a date and makes a comparison if it succeeds, based on the given
          operator (default ==).
          Upon failure, it falls back to converting value and user-entered
          expression to an integer and makes a numerical comparison based on the
          given operator (default ==)
          As a last resort, it falls back to using a Grep filter to see if the
          user given expression is contained in the todo text.
          """
          def resort_to_grep_filter():
              grep = GrepFilter(self.expression)
              return grep.match(p_todo)
  
          if not self.key or not p_todo.has_tag(self.key):
              return False
  
          if len(p_todo.tag_values(self.key)) > 1:
              # we cannot apply an ordening on a tag that appears more than once
              # in this todo item, therefore use a simple value match
              return resort_to_grep_filter()
  
          try:
              operand1 = date_string_to_date(p_todo.tag_value(self.key))
              operand2 = relative_date_to_date(self.value)
  
              if not operand2:
                  operand2 = date_string_to_date(self.value)
  
          except ValueError:
              operand1 = p_todo.tag_value(self.key)
              operand2 = self.value
  
              try:
                  operand1 = int(operand1)
                  operand2 = int(operand2)
              except ValueError:
                  return resort_to_grep_filter()
  
          return self.compare_operands(operand1, operand2)