import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String strs[] = { 
			"+1-555-5555",
			"+12-5555555",
			"+123-(555) 555-5555",
			"+1(555) 555-5555",
			"5555555555",
			"+5555555555",
			"+123-)(----"
		};
		String regex = "\\+\\d{1,3}-(?:\\(\\d{3}\\)\\h*)?\\d{3}-?\\d{4}";
		for (String s : strs)
    		System.out.printf("%s --> %s%n", s, s.matches(regex) ? "Match" : "No match");
	}
}