I've just come across an omission in re.sub which I hadn't noticed before. In re.sub the replacement string can contain escape sequences, for example: >>> repr(re.sub(r"x", r"\n", "axb")) "'a\\nb'" However: >>> repr(re.sub(r"x", r"\x0A", "axb")) "'a\\\\x0Ab'" Yes, it doesn't recognise "\xNN". Is there a reason for this? The regex module does the same, but is there any objection to me fixing it in the regex module? (I'm thinking about compatibility with re here.)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4