fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.regex.*;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. 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 |";
  11. Pattern pattern = Pattern.compile("\\|\\s*(\\d+)(?=\\s*\\|)");
  12. Matcher matcher = pattern.matcher(s);
  13. while (matcher.find()){
  14. System.out.println(matcher.group(1));
  15. }
  16. }
  17. }
Success #stdin #stdout 0.07s 52076KB
stdin
Standard input is empty
stdout
1
2
3
4
5
6
7