Code:
Arrays.asList("AAAA DDDD, DDDD".split("[\\P{L}]+")).forEach(System.out::println);
Output:
AAAA
DDDD
DDDD
Please notice it's P{L}
instead of p{L}
(which means letters). I googled it but find nothing. So could any one give me some hint about that?