code: public static String[] splitOptions(String input) {
  
          //Note that we use a regex matching all "|" characters not prefixed by "\"
  
          //Since we define a regex for matching, the input delimiter "|" needs to be escaped, as well as "\",
          //which is even double-escaped - one escaping is due to the String, one due to the regex.
  
          // emulate missing lookbehinds in JS regexes by first reversing the input,
          // then using a split with lookaheads, and finally reversing the parts resulting
          // from the split
          String reverse = reverse(input);
          String[] parts = reverse.split("\\|(?!\\\\)");
          String[] finalParts = new String[parts.length];
          int lastIndex = parts.length - 1;
          for (int i = 0; i < parts.length; i++) {
              finalParts[lastIndex - i] = reverse(parts[i]);
          }
          return finalParts;
  
      }
docs: Splits the options string at every unescaped input delimiter, i.e., every unescaped "|".
  @param input the options string
  @return the array with the various options