No need to start a new thread! This also works for meString s = "a b c d e";
System.out.println(s);
s = s.replaceAll("b|d","?);
System.out.println(s);
s = s.replaceAll("?, "xxxx");
System.out.println(s);
Heres an idea. Why dont you check your String encoding?
http://mindprod.com/jgloss/encoding.html
And then, use its unicode (or whatever) number in the regex instead
of the actual symbol.
Also, different fonts might have symbols in different places.
In Windows:
Start > All Programs > Accessories > System Tools > Char Map
For me: TM = U+2122 / ALT+0153 in Arial