presto-resource-group-managers/src/main/java/io/prestosql/plugin/resourcegroups/StaticSelector.java/StaticSelector/addVariableValues
class StaticSelector:    private void addVariableValues(Pattern pattern, String candidate, Map<String, String> mapping)
    {
        for (String key : variableNames) {
            Matcher keyMatcher = pattern.matcher(candidate);
            if (keyMatcher.find()) {
                try {
                    String value = keyMatcher.group(key);
                    if (value != null) {
                        mapping.put(key, value);
                    }
                }
                catch (IllegalArgumentException ignored) {
                    // there was no capturing group with the specified name
                }
            }
        }
    }