code: static boolean matchForward(char[] chars, char[] pattern, int[] cursor) {
      if (pattern.length > cursor[1] - cursor[0])
        return false;
      int index = 0;
      while (index < pattern.length)
        if (chars[cursor[0]++] != pattern[index++])
          return false;
      return true;
    }
docs: Match characters in a forward direction