Escapes the strings used in regexes

Fixes #2