escape strings when building search regexes