New submission from Samuel Warfield <warfi...@mymail.mines.edu>:
Bug with regex substitutions. When calling the re.sub() method directly char(92), the double backslash charecter as the replacement, throws an exception. Whereas compiling a regex object then calling its own .sub() method works completely fine. I did a quick look through the bug tracker search for similar issues and none were reported. # Breaks re.sub(r'\\\\', chr(92), stringy_thingy) vs # Works parser = re.compile(r'\\\\') parser.sub(chr(92), stringy_thingy) # Where stringy_thingy is a string that is being substituted ---------- components: Regular Expressions messages: 328509 nosy: Samuel Warfield, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.sub does not play nice with chr(92) versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35072> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com