question: static String expandEnvironmentVariables ( String value ) { if ( null == value ) { return null ; } Matcher m = ENV_VAR_PATTERN . matcher ( value ) ; StringBuffer sb = new StringBuffer ( ) ; while ( m . find ( ) ) { String envVarValue = null ; String envVarName = null == m . group ( 1 ) ? m . group ( 2 ) : m . group ( 1 ) ; if ( envVarName . startsWith ( ( "env." ) ) ) { envVarValue = System . getenv ( envVarName . substring ( 3 ) ) ; } else { envVarValue = System . getProperty ( envVarName ) ; } m . appendReplacement ( sb , null == envVarValue ? "" : Matcher . quoteReplacement ( envVarValue ) ) ; } m . appendTail ( sb ) ; return sb . toString ( ) ; }
target:  Return the string value, expanding any environment variables found in the expression. <p> For example    "Home dir is ${env.HOME}"  will expand using the env var "HOME" to something like "Home dir is /home/justin_bieber"