code: public static String replaceExpression(String pValue) {
          if (pValue == null) {
              return null;
          }
          Matcher matcher = EXPRESSION_EXTRACTOR.matcher(pValue);
          StringBuffer ret = new StringBuffer();
          try {
              while (matcher.find()) {
                  String var = matcher.group(1);
                  String value;
                  if (var.equalsIgnoreCase("host")) {
                      value = getLocalAddress().getHostName();
                  } else if (var.equalsIgnoreCase("ip")) {
                      value = getLocalAddress().getHostAddress();
                  } else {
                      String key = extractKey(var,"env");
                      if (key != null)  {
                          value = System.getenv(key);
                      } else {
                          key = extractKey(var,"prop");
                          if (key != null) {
                              value = System.getProperty(key);
                          } else {
                              throw new IllegalArgumentException("Unknown expression " + var + " in " + pValue);
                          }
                      }
                  }
                  matcher.appendReplacement(ret, value != null ? value.trim() : null);
              }
              matcher.appendTail(ret);
          } catch (IOException e) {
              throw new IllegalArgumentException("Cannot lookup host" + e, e);
          }
          return ret.toString();
      }
docs: Replace expression ${host} and ${ip} with the localhost name or IP in the given string.
  In addition the notation ${env:ENV_VAR} and ${prop:sysprop} can be used to refer to environment
  and system properties respectively.
  
  @param pValue value to examine
  @return the value with the variables replaced.
  @throws IllegalArgumentException when the expression is unknown or an error occurs when extracting the host name