Used for a usage of a variable. The followings notation is supported: ${Var} Simple usage of a variable with the name Var. ${Var=Tobi} If Var is not set, then use Tobi as default value ${Var=Tobi_$[env]} Default values may contain other variables. Use [ and ] instead of { }
示例#1
0
        private string ReplaceVariables(Match match)
        {
            var variableUsage = new VariableUsage(match.Groups["Name"].Value, Variables);

            VariableUsageList.Add(variableUsage);

            var parsed = variableUsage.GetValueOrDefault(Variables);

            while (VariableRegex.IsMatch(parsed))
            {
                parsed = TransformVariables(parsed);
            }

            return(parsed);
        }
        private string ReplaceVariables(Match match)
        {
            var variableUsage = new VariableUsage(match.Groups["Name"].Value, Variables);

            VariableUsageList.Add(variableUsage);

            var parsed = variableUsage.GetValueOrDefault(Variables);

            while (VariableRegex.IsMatch(parsed))
            {
                parsed = TransformVariables(parsed);
            }

            return parsed;
        }