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

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* 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 ok_pattern = "(?:itId=<(\\d+)>) Code < |\\G(?!^)\\[OK:([^]]+)\\]\\s*";
		Pattern p_ok = Pattern.compile(ok_pattern);
		String testString = "RANDOMTEXT itId=<1232> Code < [OK:AZ1000105]  [OK:10000006] [OK:F1000000007] > RANDOMTEXT";
		Matcher m = p_ok.matcher(testString);
		
		while(m.find()) {
			if (null != m.group(1)) {
				System.out.println("itId: " + m.group(1));	
			}
			if (null != m.group(2)) {
				System.out.println("Ok code: " + m.group(2));	
			}
		    
		}
	}
}