Andrez Segovia

Find All Letters Event Grave And Acute Ones With a Regular Expression

Published on • • 49 Words
1String value = "a Á á É é Í 8 . - ? í Ó ó Ú ú ü / ! ¿";  
2  
3Stream.of(value.split("")).filter(s -> s.matches("\\p{L}"))  
4        .forEach(System.out::printf);
5
6//ÁaáÉeéÍiíÓóoOÚúü

The regular expression uses a Unicode character class escape with a General category property for filter only the letters.