I have a list of legal characters and I want to remove all others chars from text.
// my legal chars. a-Z, numbers, space, _, - and percentage
string legalChars = "[\p{L}\p{Nd}_\- %]*"
string text = "[update], Text with {illegal} chars such as: !? {}";
I do find a lot of examples for removing illegal chars. I want to do the opposite.