Message242205
A simple multiline regex fails when just the re.MULTILINE argument is used, but works when equivalent alternative methods are used. This was tested on Python2.7.8 on FreeBSD and Win32 Python2.7.9
data = re.sub(r'#.*', '', text, re.MULTILINE) # fails
data = re.sub(r'(?m)#.*', '', text) # Ok
data = re.sub(r'#.*', '', text, re.MULTILINE|re.DEBUG) # Ok
All the expressions work correctly with Win64 Python3.4.3
The attached file has the code and with a sample of text that fails. |
|
Date |
User |
Action |
Args |
2015-04-28 19:25:28 | Stephen.Evans | set | recipients:
+ Stephen.Evans, ezio.melotti, mrabarnett |
2015-04-28 19:25:28 | Stephen.Evans | set | messageid: <1430249128.2.0.387298041566.issue24071@psf.upfronthosting.co.za> |
2015-04-28 19:25:28 | Stephen.Evans | link | issue24071 messages |
2015-04-28 19:25:28 | Stephen.Evans | create | |
|