Whatever
 12.08.2016 10:08

Статьи How to get IP:Port from string in Java

Regex solution:
private String pullIpPort(String input)
{
	Pattern p = Pattern.compile("(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}):(\\d{1,5})");
	Matcher m = p.matcher(input);
	return m.find() ? (m.group(1) + ":" + m.group(2)) : "Not found";
}
Found at stackoverflow.

Leave a Reply

*