Reputation: 31
For example Input
Hello 1/(¤
Output should be
Hello ****
Upvotes: 3
Views: 2176
Reputation: 45744
To make your regular expression work with international alphabets (e.g. to treat letters with diacritics as letters too, like ä
, à
, etc.), you should use the unicode-aware expression for a non-letter character:
"Héllö 1/(¤".replaceAll("[^\\p{L}\\s]", "*");
Upvotes: 7