longest.end[0] = longest.index; longest.finish(input); return longest;
*/ best.end[0] = best.index; best.finish(input); return best;
  REMatch getMatchImpl(CharIndexed input, int anchor, int eflags, StringBuffer buffer) {      // Create a new REMatch to hold results      REMatch mymatch = new REMatch(numSubs, anchor, eflags);      do {	  // Optimization: check if anchor + minimumLength > length	  if (minimumLength == 0 || input.charAt(minimumLength-1) != CharIndexed.OUT_OF_BOUNDS) {	      if (match(input, mymatch)) {		  // Find longest match of them all to observe leftmost longest		  REMatch longest = mymatch;		  while ((mymatch = mymatch.next) != null) {		      if (mymatch.index > longest.index) {			  longest = mymatch;		      }		  }		  		  longest.end[0] = longest.index;		  longest.finish(input);		  return longest;	      }	  }	  mymatch.clear(++anchor);	  // Append character to buffer if needed	  if (buffer != null && input.charAt(0) != CharIndexed.OUT_OF_BOUNDS) {	      buffer.append(input.charAt(0));	  }      } while (input.move(1));            // Special handling at end of input for e.g. "$"      if (minimumLength == 0) {	  if (match(input, mymatch)) {	      mymatch.finish(input);	      return mymatch;	  }      }      return null;  }