in reply to Replace not working
As well as knowing other substitutions that work it may help you to understand why yours fails.
Your pattern '-[^\s-~]' matches two characters: the literal '-' matches one and the character class matches another. In your string, the first pair of characters that matches the expression is '-Y'. Thus '-Y' is removed from your string and replaced with ' '.
update: rewrote to clarify.
|
|---|