Escape regexes correctly