String (String value, UnaryOperator<String> runtimeProperties) { Matcher matcher = ARG_LINE_PATTERN.matcher(value); StringBuilder sb = new StringBuilder(); while (matcher.find()) { String replacement = runtimeProperties.apply(matcher.group(1)); matcher.appendReplacement(sb, Matcher.quoteReplacement(replacement == null ? matcher.group() : replacement)); } matcher.appendTail(sb); return sb.toString(); }