def fix_re_escapes(self, txt: str) -> str:
def _subf(matchobj):<EOL><INDENT>o = matchobj.group(<NUM_LIT:0>).translate(self.re_trans_table)<EOL>if o[<NUM_LIT:1>] in '<STR_LIT>':<EOL><INDENT>return o[<NUM_LIT:0>] + '<STR_LIT>'['<STR_LIT>'.index(o[<NUM_LIT:1>])]<EOL><DEDENT>else:<EOL><INDENT>return o if o[<NUM_LIT:1>] in '<STR_LIT>' else o[<NUM_LIT:1>]<EOL><DEDENT><DEDENT>return re.sub(r'<STR_LIT>', _subf, txt, flags=re.MULTILINE + re.DOTALL + re.UNICODE)<EOL>
The ShEx RE engine allows escaping any character.  We have to remove that escape for everything except those
        that CAN be legitimately escaped

        :param txt: text to be escaped