code: public Map<String, String> mapVariables(String matchedPath) {
          if (pattern != null) {
              //For each variable inside our registered path we will need to map it to the corresponding value in the matchedURL
              Map<String, String> map = new HashMap<String, String>();
  
              //Build matchers so we can use their matched groups
              Matcher matcherValue = pattern.matcher(matchedPath);
              Matcher matcherKey = pattern.matcher(registeredPath);
              matcherValue.matches();
              matcherKey.matches();
  
              if (matcherValue.groupCount() != matcherKey.groupCount()) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(this, tc, "Handler path matched expression groups did not match. Matched path: " + matchedPath + " | Registered path:" + registeredPath);
                  }
              }
  
              //Group(0) is the entire expression, so skip that one
              for (int i = 1; i <= matcherValue.groupCount(); i++) {
                  String key = matcherKey.group(i);
                  //Remote leading and trailing backets {..}
                  key = key.substring(1, key.length() - 1);
  
                  String value = matcherValue.group(i);
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(this, tc, "Mapping key: " + key + " to value: " + value);
                  }
  
                  //Insert into map
                  map.put(key, value);
              }
  
              return map;
          }
  
          return null;
      }
docs: This method assume that the incoming matchedPath returns "true" for a call to matches(String)