} else {  i++;
  private static String toNonGreedy(String regexp)  {    int len = regexp.length();    StringBuilder sb = new StringBuilder();    char quote = 0;    for (int i = 0; i < len; i++) {      char ch = regexp.charAt(i);      switch (ch) {      case '\\':        sb.append(ch);        if (i + 1 < len) {          sb.append(regexp.charAt(i + 1));          i++;        }        break;      case '[':        sb.append(ch);        if (quote == 0)          quote = ch;        break;      case ']':        sb.append(ch);        if (quote == '[')          quote = 0;        break;      case '*':      case '?':      case '+':        sb.append(ch);        if (i + 1 < len && (ch = regexp.charAt(i + 1)) != '?') {          sb.append('?');        }        break;      default:        sb.append(ch);      }    }    return sb.toString();  }