[ad_1]
Use this:
String replaced = yourString.replaceAll("[^\\w\\xAE\\xA9~. -]", "_");
- In Java,
\wmatches all ASCII letters, numbers and underscore A9andAEare the hex codes for copyright and registered trademark
1
[ad_2]
solved Java String replace Regular Expression