Skip to content
Permalink
Browse files

Update core/src/main/java/hudson/Util.java

  • Loading branch information
xusun committed Oct 18, 2011
1 parent 0f2f7be commit b8dee2c710637e718290f93c31d3854099d2d157
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/src/main/java/hudson/Util.java
@@ -137,7 +137,7 @@
/**
* Pattern for capturing variables. Either $xyz or ${xyz}, while ignoring "$$"
*/
private static final Pattern VARIABLE = Pattern.compile("\\$([A-Za-z0-9_]+|\\{[A-Za-z0-9_]+\\}|\\$)");
private static final Pattern VARIABLE = Pattern.compile("[\\$%]([A-Za-z0-9_]+|\\{[A-Za-z0-9_]+\\})[\\$%])");

/**
* Replaces the occurrence of '$key' by <tt>properties.get('key')</tt>.
@@ -166,7 +166,7 @@ public static String replaceMacro(String s, VariableResolver<String> resolver) {
Matcher m = VARIABLE.matcher(s);
if(!m.find(idx)) return s;

String key = m.group().substring(1);
String key = m.group(1);

// escape the dollar sign or get the key to resolve
String value;

1 comment on commit b8dee2c

@xusun

This comment has been minimized.

Copy link
Owner Author

xusun commented on b8dee2c Oct 18, 2011

To make this function work on Windows Environments %VAR%

Please sign in to comment.
You can’t perform that action at this time.