def _escape(self, s):
for ch, r_ch in self.ESCAPE_SETS:<EOL><INDENT>s = s.replace(ch, r_ch)<EOL><DEDENT>return s<EOL>
Escape bad characters for regular expressions.

        Similar to `re.escape` but allows '%' to pass through.