You can use \p{L} to match all Unicode characters. Example:
public static void main(String[] args) throws IOException { String[] test = {"asdEWR1", "ąęóöòæûùÜ", "sd,", "✀","✁","✂","✃","✄","✅","✆","✇","✈"}; for (String s : test) System.out.println(s + " => " + s.replaceAll("[^\\p{L}^\\d]", "")); }
outputs:
asdEWR1 => asdEWR1 ąęóöòæûùÜ => ąęóöòæûùÜ sd, => sd ✀ => ✁ => ✂ => ✃ => ✄ => ✅ => ✆ => ✇ => ✈ =>
source share