Reputation: 994
I want to replace all non-alphanumeric characters, but keep Æ, Ø, Å, æ, ø, å.
Current code:
replaceAll("\\P{Alnum}", "_")
Upvotes: 1
Views: 733
Reputation: 4749
Use explicit white list instead:
replaceAll("[^a-zA-Z0-9ÆØÅæøå]","_")
Look at the similar question
Upvotes: 3