code: def add_monitor(self, pattern, callback, limit=80):
          
          self.monitors.append([to_regexs(pattern), callback, 0, limit])
docs: Calls the given function whenever the given pattern matches the
          buffer.
  
          Arguments passed to the callback are the index of the match, and
          the match object of the regular expression.
  
          :type  pattern: str|re.RegexObject|list(str|re.RegexObject)
          :param pattern: One or more regular expressions.
          :type  callback: callable
          :param callback: The function that is called.
          :type  limit: int
          :param limit: The maximum size of the tail of the buffer
                        that is searched, in number of bytes.