code: def get_match_number(self, pattern, case=False, regexp=False):
          
          position = self.textCursor().position()
          source_text = self.get_text(position_from='sof', position_to=position)
          match_number = self.get_number_matches(pattern,
                                                 source_text=source_text,
                                                 case=case, regexp=regexp)
          return match_number
docs: Get number of the match for the searched text.