code: private String checkPattern(final String value, final Pattern pattern, final boolean withBrace) {
          String res = value;
          final Matcher matcher = pattern.matcher(value);
          while (matcher.find()) {
              final String envName = matcher.group(2);
              if (!this.varenvMap.containsKey(envName)) {
                  final String envValue = System.getenv(envName);
                  this.varenvMap.put(envName, envValue);
              }
              // Check if the var env is ready
              if (this.varenvMap.get(envName) != null) {
                  if (withBrace) {
                      res = res.replace("${" + envName + "}", this.varenvMap.get(envName));
                  } else {
                      res = res.replace("$" + envName, this.varenvMap.get(envName));
                  }
              } else {
                  LOGGER.log(UNDEFINED_ENV_VAR, envName);
              }
          }
          return res;
      }
docs: Check if the given string contains an environment variable.
  
  @param value the string value to parse
  @param pattern the regex pattern to use
  @param withBrace true for ${varname}, false for $varname
  
  @return the given string updated with right environment variable content