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 s = "A#B^C&D!ased&acdf@Mhj%";
  9. String temp[] = s.split("(?<=[#^&!@%]+)");
  10. for (String tok : temp) {
  11. System.out.println(tok);
  12. }
  13. }
  14. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
A#
B^
C&
D!
ased&
acdf@
Mhj%