docs: private static StringBuilder escapeRegex(final StringBuilder regex, final String value, final boolean unquote) {
          regex.append("\\Q");
          for (int i = 0; i < value.length(); ++i) {
              char c = value.charAt(i);
              switch (c) {
                  case '\'':
                      if (unquote) {
                          if (++i == value.length()) {
                              return regex;
                          }
                          c = value.charAt(i);
                      }
                      break;
                  case '\\':
                      if (++i == value.length()) {
                          break;
                      }
  
                      regex.append(c); // we always want the original \
                      c = value.charAt(i); // Is it followed by E ?
                      if (c == 'E') { // \E detected
                          regex.append("E\\\\E\\"); // see comment above
                          c = 'Q'; // appended below
                      }
                      break;
                  default:
                      break;
              }
              regex.append(c);
          }
          regex.append("\\E");
          return regex;
      }