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