code: def append(self, data):
          
          self.io.write(data)
          if not self.monitors:
              return
  
          # Check whether any of the monitoring regular expressions matches.
          # If it does, we need to disable that monitor until the matching
          # data is no longer in the buffer. We accomplish this by keeping
          # track of the position of the last matching byte.
          buf = str(self)
          for item in self.monitors:
              regex_list, callback, bytepos, limit = item
              bytepos = max(bytepos, len(buf) - limit)
              for i, regex in enumerate(regex_list):
                  match = regex.search(buf, bytepos)
                  if match is not None:
                      item[2] = match.end()
                      callback(i, match)
docs: Appends the given data to the buffer, and triggers all connected
          monitors, if any of them match the buffer content.
  
          :type  data: str
          :param data: The data that is appended.