code: public static Map.Entry<String,Integer> findUrlAndPort( String url ) {
  
  		Matcher m = Pattern.compile( ".*(:\\d+).*" ).matcher( url );
  		String portAsString = m.find() ? m.group( 1 ).substring( 1 ) : null;
  		Integer port = portAsString == null ? - 1 : Integer.parseInt( portAsString );
  		String address = portAsString == null ? url : url.replace( m.group( 1 ), "" );
  
  		return new AbstractMap.SimpleEntry<>( address, port );
  	}
docs: Parses a raw URL and extracts the host and port.
  @param url a raw URL (not null)
  @return a non-null map entry (key = host URL without the port, value = the port, -1 if not specified)