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

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String s = "| 2021-08-18 01:28 | Twitter | [INTL TWITTER AAA BBB CC ] (https://t...content-available-to-author-only...a.com/#/groups/123) | Twitter XX (C++, C#) | 1 | 2 | 3 | 4 | [ aaaa ] | 5 | 6 | 7 |";
		Pattern pattern = Pattern.compile("\\|\\s*(\\d+)(?=\\s*\\|)");
		Matcher matcher = pattern.matcher(s);
		while (matcher.find()){
			System.out.println(matcher.group(1)); 
		} 
	}
}