Fix regex error on strings containing \

Fix #35
I think you got it backwards:

```py
path.replace(expanduser('~'), '~')
```