fork(2) download
  1. import java.util.*;
  2. import java.util.regex.*;
  3. import java.lang.*;
  4. import java.io.*;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. Pattern pattern = Pattern.compile("(\\p{Alnum}+?)([0-9]*)");
  11. Matcher matcher = pattern.matcher("T3st12345");
  12. if (matcher.matches()) {
  13. System.out.println(matcher.group(1));
  14. System.out.println(matcher.group(2));
  15. }
  16. }
  17. }
Success #stdin #stdout 0.07s 2841600KB
stdin
Standard input is empty
stdout
T3st
12345