fork(4) 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 text = "quick! brown? fox jumps.over! the lazy dog?";
  9. String[] ss = text.split("(?<=[.!?])\\s*");
  10. for (String s : ss) {
  11. System.out.println(s);
  12. }
  13. }
  14. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
quick!
brown?
fox jumps.
over!
the lazy dog?