code: public int expect(String pattern) throws MalformedPatternException, Exception {
          logger.trace("Searching for '" + pattern + "' in the reader stream");
          return expect(pattern, null);
      }
docs: Attempts to detect the provided pattern as an exact match.
  @param pattern the pattern to find in the reader stream
  @return the number of times the pattern is found,
  or an error code
  @throws MalformedPatternException if the pattern is invalid
  @throws Exception if a generic error is encountered