/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String text = "node [\n" +
		"       id 2\n" +
		"       label \"node 2\"\n" +
		"       thisIsASampleAttribute 43\n" +
		"   ]\n" +
		"   node [\n" +
		"       id 3\n" +
		"       label \"node 3\"\n" +
		"       thisIsASampleAttribute 44\n" +
		"   ]\n";
		
		Pattern p = Pattern.compile("node \\[\\n((?:.*?|\\n)*?)\\]", Pattern.MULTILINE);
		Matcher m = p.matcher(text);
		while(m.find())
		{
		    System.out.println(m.group(1));
		}
	}
}