fork(5) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String value = "上目黒1丁目2-3";
  10. String[] res = value.split("(?U)(?=\\d)", 2);
  11. System.out.println(Arrays.toString(res));
  12. //Matcher matcher = Pattern.compile("([^\\d]+)(.*)").matcher(s);
  13. //if (matcher.matches()) {
  14. // System.out.println(matcher.group(1).trim());
  15. // System.out.println("sep");
  16. // System.out.println(matcher.group(2));
  17. //}
  18. }
  19. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
[上目黒, 1丁目2-3]