import java.util.*;
import java.util.regex.*;
import java.lang.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String title = null, part2 = null, ip = null;

		String remoteUriStr = "\"+12222222222\" <sip:+12222222222@192.168.140.1>";
		String regex = "\"(.+?)\" \\<sip:\\+(.+?)@(.+?)\\>";
		Pattern p = Pattern.compile(regex);
		Matcher matcher = p.matcher(remoteUriStr);
		if (matcher.matches()) {
		    title = matcher.group(1);
		    part2 = matcher.group(2);
		    ip = matcher.group(3);
		}

		System.out.println("Title: " + title);
		System.out.println("group2: " + part2);
		System.out.println("ip: " + ip);
	}
}