code: public static Config parseConfig(String args, String ifc) {
          Pattern pattern = Pattern.compile(
                  "^(?:((?:[\\w.]+)|(?:\\[.+])):)?" +  // host name, or ipv4, or ipv6 address in brackets
                          "(\\d{1,5}):" +              // port
                          "(.+)");                     // config file
  
          Matcher matcher = pattern.matcher(args);
          if (!matcher.matches()) {
              throw new IllegalArgumentException("Malformed arguments - " + args);
          }
  
          String givenHost = matcher.group(1);
          String givenPort = matcher.group(2);
          String givenConfigFile = matcher.group(3);
  
          int port = Integer.parseInt(givenPort);
  
          InetSocketAddress socket;
          if (givenHost != null && !givenHost.isEmpty()) {
              socket = new InetSocketAddress(givenHost, port);
          }
          else {
              socket = new InetSocketAddress(ifc, port);
              givenHost = ifc;
          }
  
          return new Config(givenHost, port, givenConfigFile, socket);
      }
docs: Parse the Java Agent configuration. The arguments are typically specified to the JVM as a javaagent as
  {@code -javaagent:/path/to/agent.jar=<CONFIG>}. This method parses the {@code <CONFIG>} portion.
  @param args provided agent args
  @param ifc default bind interface
  @return configuration to use for our application