code: public static final int findNextCharNotPrefixedBy(ByteBuf buf, char c, char prefix) {
          int found =  buf.bytesBefore((byte) c);
          if (found < 1) {
              return found;
          } else {
              int from;
              while (found > -1 && (char) buf.getByte(
                      buf.readerIndex() + found - 1) == prefix) {
                  //advance from
                  from = buf.readerIndex() + found + 1;
                  //search again
                  int next = buf.bytesBefore(from, buf.readableBytes() - from + buf.readerIndex(), (byte) c);
                  if (next == -1) {
                      return -1;
                  } else {
                      found += next + 1;
                  }
              }
              return found;
          }
      }
docs: Find the number of bytes until next occurrence of the character c
  from the current {@link ByteBuf#readerIndex() readerIndex} in buf,
  with the twist that if this occurrence is prefixed by the prefix
  character, we try to find another occurrence.
  
  @param buf the {@link ByteBuf buffer} to look into.
  @param c the character to search for.
  @param prefix the character to trigger a retry.
  @return the position of the first occurrence of c that is not prefixed by prefix
  or -1 if none found.