- Read the documentation to see how to escape special characters.
- Make sure you understand when characters do not need to be escaped, eg. in character classes.
- Then write a regex to replace any of the characters except $ OR $ followed by a digit, with a space and if you captured a digit replace it also.
Go on try it it's not that hard and it's quite satisfying when you work it out yourself.