fork(3) download
  1. import java.util.*;
  2. import java.util.regex.*;
  3.  
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String s = "🙁🙂abc🙁";
  9. List<String> results = new ArrayList<>();
  10. Matcher m = Pattern.compile("\\P{M}\\p{M}*+").matcher(s);
  11. while (m.find()) {
  12. results.add(m.group());
  13. }
  14. System.out.println(results);
  15. }
  16. }
Success #stdin #stdout 0.06s 33724KB
stdin
Standard input is empty
stdout
[🙁, 🙂, a, b, c, 🙁]