Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Which is the Regex for these symbols?
-, –, %, /, ., "", «», '', ', <, >, &, :, (, ), !, ^, *
Ι need to Replace them all with Space.
String r = t.replaceAll('[-%/.<>&:]',' ');
// Put all your symbols here.
String t = 'I-am%Noor/who/are:you<I>am';
String r = t.replaceAll('[-_%/."<>&:()!/*/^]',' ');
I am Noor who are you I am
Just adding another option here: you can utilize some great playground tools to figure it our or test out your regex before putting it into your code.
and then a great resource for learning regex as well
Required, but never shown