code: protected synchronized void replaceQuerySearchPatterns() {
  
          String currentKey = null;
          String currentValue = null;
          int startIndex = 0;
          int endIndex = 0;
          int lastIndex = 0;
  
          Iterator<String> allKeys = m_queries.keySet().iterator();
          while (allKeys.hasNext()) {
              currentKey = allKeys.next();
              currentValue = m_queries.get(currentKey);
              startIndex = 0;
              endIndex = 0;
              lastIndex = 0;
  
              while ((startIndex = currentValue.indexOf("${", lastIndex)) != -1) {
                  endIndex = currentValue.indexOf('}', startIndex);
                  if ((endIndex != -1) && !currentValue.startsWith(QUERY_PROJECT_SEARCH_PATTERN, startIndex - 1)) {
  
                      String replaceKey = currentValue.substring(startIndex + 2, endIndex);
                      String searchPattern = currentValue.substring(startIndex, endIndex + 1);
                      String replacePattern = this.readQuery(replaceKey);
  
                      if (replacePattern != null) {
                          currentValue = CmsStringUtil.substitute(currentValue, searchPattern, replacePattern);
                      }
                  }
  
                  lastIndex = endIndex + 2;
              }
              m_queries.put(currentKey, currentValue);
          }
      }
docs: Replaces patterns ${XXX} by another property value, if XXX is a property key with a value.<p>