code: public static String extractPort(final String host) {
          if (containsPort(host)) {
              return host.substring(host.indexOf(":") + 1, host.length());
          } else {
              return null;
          }
      }
docs: Extract the port string from a string in the pattern "hostname:port"
  
  @param host the hostname
  
  @return the extracted port string, or null if the pattern is not matched.