fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String test = "hostname.domain.com/abc/def/v1.8/ghi";
  9. for (String s : test.split("(?<!\\d)[.](?!\\d)")) {
  10. System.out.println(s);
  11. }
  12. }
  13. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
hostname
domain
com/abc/def/v1.8/ghi