docs: public void setPattern(Pattern regex)
      {
          this.re = regex;
  
          int memregCount, counterCount, lookaheadCount;
          if ((memregCount = regex.memregs) > 0) {
              MemReg[] memregs = new MemReg[memregCount];
              for (int i = 0; i < memregCount; i++) {
                  memregs[i] = new MemReg(-1); //unlikely to SearchEntry, in this case we know memreg indices by definition
              }
              this.memregs = memregs;
          }
  
          if ((counterCount = regex.counters) > 0) counters = new int[counterCount];
  
          if ((lookaheadCount = regex.lookaheads) > 0) {
              LAEntry[] lookaheads = new LAEntry[lookaheadCount];
              for (int i = 0; i < lookaheadCount; i++) {
                  lookaheads[i] = new LAEntry();
              }
              this.lookaheads = lookaheads;
          }
  
          this.memregCount = memregCount;
          this.counterCount = counterCount;
          this.lookaheadCount = lookaheadCount;
  
          first = new SearchEntry();
          defaultEntry = new SearchEntry();
          minQueueLength = regex.stringRepr.length() / 2;  // just evaluation!!!
  
      }