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

class Test
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String text = "lore epsum dimsum ${ITEM_NAME} wonton kimchi ${ITEM_NAME_2}";
		Pattern p = Pattern.compile("\\$\\{([^{}]*)}");
	    Matcher m = p.matcher(text);
	    List<String> res = new ArrayList<>();
	    while(m.find()) {
	    	res.add(m.group(1));
	    }
	    System.out.println(res);
	}
}