I often copy text from a website or pdf into a variable and once in a while pasting it back into WordPad gives weird results.
It used to originate more frequently within larger Facebook texts or YouTube comments.
One example from a pdf is where bullets were changed into a corner like character, etc.
I assume many of these could be control characters?
What is the best way to filter them out, please?
From reading in the manual, my only guess was something like the following, but it seems to do nothing (not sure though, and less easy to test for me...).
$text = StringRegExpReplace ( $text, '[[:cntrl:]]', "" )
Or is it something with [:print:] ? (meaning, "give me only the characters that would normally print?")
I don't mind if your solution removes Returns too (though ideally not), cause I usually remove those myself.
Thank You for any pointers!