Skip to content

Commit

Permalink
[jmxfetch][service_discovery] fixing regex to be more Java6 friendly.
Browse files Browse the repository at this point in the history
  • Loading branch information
truthbk committed Nov 30, 2016
1 parent 9ccf81a commit aa99991
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/datadog/jmxfetch/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ public void doIteration() {
}

public boolean addConfig(String name, YamlParser config) {
Pattern pattern = Pattern.compile(SERVICE_DISCOVERY_PREFIX+"(?<check>.{1,30})(?<version>_\\d{0,30})");
// named groups not supported with Java6: "(?<check>.{1,30})_(?<version>\\d{0,30})"
Pattern pattern = Pattern.compile(SERVICE_DISCOVERY_PREFIX+"(.{1,30})_(\\d{0,30})");

Matcher matcher = pattern.matcher(name);
if (!matcher.find()) {
Expand Down

0 comments on commit aa99991

Please sign in to comment.