escape the regex so this works on mac and linux