code: def compileMatchList(self):
          
          # Get the new sub-string to search for.
          self.matchList = []
  
          # Return immediately if the input field is empty.
          numChar = len(self.toReplace)
          if numChar == 0:
              return
  
          # Compile a list of all sub-string spans.
          stop = 0
          text = self.qteWidget.text()
          while True:
              start = text.find(self.toReplace, stop)
              if start == -1:
                  break
              else:
                  stop = start + numChar
                  self.matchList.append((start, stop))
docs: Compile the list of spans of every match.