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.
In reply to Re: Replace not working
by ig
in thread Replace not working
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |