code: public static String[] parseFilterDescriptor(String mapDesc) throws CertificateMapperException {
          if (mapDesc == null || mapDesc.isEmpty()) {
              String msg = Tr.formatMessage(tc, WIMMessageKey.INVALID_CERTIFICATE_FILTER, mapDesc);
              throw new CertificateMapperException(WIMMessageKey.INVALID_CERTIFICATE_FILTER, msg);
          }
  
          int prev_idx, cur_idx, end_idx;
          ArrayList<String> list = new ArrayList<String>();
          for (prev_idx = cur_idx = 0, end_idx = mapDesc.length(); cur_idx < end_idx; prev_idx = cur_idx) {
              boolean isSquareBrace = false;
              if (mapDesc.contains("$[")) {
                  isSquareBrace = true;
                  cur_idx = mapDesc.indexOf("$[", prev_idx);
              } else {
                  cur_idx = mapDesc.indexOf("${", prev_idx);
              }
              if (cur_idx == -1) {
                  if (prev_idx < end_idx) {
                      list.add(mapDesc.substring(prev_idx));
                  }
                  break;
              }
              if (prev_idx < cur_idx) {
                  list.add(mapDesc.substring(prev_idx, cur_idx));
              }
              prev_idx = cur_idx;
              if (isSquareBrace) {
                  cur_idx = mapDesc.indexOf("]", prev_idx);
              } else {
                  cur_idx = mapDesc.indexOf("}", prev_idx);
              }
              if (cur_idx == -1) {
                  String msg = Tr.formatMessage(tc, WIMMessageKey.INVALID_CERTIFICATE_FILTER, mapDesc);
                  throw new CertificateMapperException(WIMMessageKey.INVALID_CERTIFICATE_FILTER, msg);
              }
              cur_idx++;
              list.add(mapDesc.substring(prev_idx, cur_idx));
          }
          String[] mapDescEles = new String[list.size()];
          for (int idx = 0; idx < list.size(); idx++) {
              mapDescEles[idx] = list.get(idx);
          }
          return mapDescEles;
      }
docs: /*
  Parse the map descriptor.
  Return an array of tokens.
  Copy from com.ibm.ws.security.registry.ldap.CertificateMapper