This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Stephen.Evans
Recipients Stephen.Evans, ezio.melotti, mrabarnett
Date 2015-04-28.19:25:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:28Stephen.Evanssetrecipients: + Stephen.Evans, ezio.melotti, mrabarnett
2015-04-28 19:25:28Stephen.Evanssetmessageid: <>
2015-04-28 19:25:28Stephen.Evanslinkissue24071 messages
2015-04-28 19:25:28Stephen.Evanscreate