Fixes #212 - replacing r/ is bad practise

Replacing r/ can and will match comment strings and isn't as strict/safe
as /r/. Perhaps when adding shortcuts we should have a full regex match
so we can reject incorrect shortcuts? However, this fixes #212 and makes
this bit of script more robust.