Message292079
The following code demonstrates:
import re
text = 'ab\\'
exp = re.compile('a')
print(re.sub(exp, text, ''))
If you remove the backslash(es), the code runs fine.
This appears to be specific to the re module and only to strings that end in (even properly escaped) backslashes. You could easily receive raw data like this from freehand input sources so it would be nice not to have to remove trailing backslashes before running a regular expression. |
|
Date |
User |
Action |
Args |
2017-04-21 21:18:05 | Patrick Foley | set | recipients:
+ Patrick Foley, ezio.melotti, mrabarnett |
2017-04-21 21:18:05 | Patrick Foley | set | messageid: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> |
2017-04-21 21:18:05 | Patrick Foley | link | issue30133 messages |
2017-04-21 21:18:05 | Patrick Foley | create | |
|