import java.util.regex.Matcher;
import java.util.regex.Pattern;

class Main {
	public static final String EXAMPLE_TEST = "s:64:\"first string\" some content s:64:\"second string\" some other content s:64:\"third string\" some content s:64:\"fourth string\"";

	public static void main(String[] args) {
		Pattern pattern = Pattern.compile("s:64:\"(.*?)\"");
		Matcher matcher = pattern.matcher(EXAMPLE_TEST);
		// Check all occurance
                int count = 0;
		while (matcher.find() && count++ < 2) {
			System.out.println("Group : " + matcher.group(1));
		}
	}
} 