Message172775
'$' will match at the end of the string or just before the final '\n':
>>> re.match(r'abc$', 'abc\n')
<_sre.SRE_Match object at 0x00F15448>
So shouldn't you be using r'\Z' instead?
>>> re.match(r'abc\Z', 'abc')
<_sre.SRE_Match object at 0x00F15410>
>>> re.match(r'abc\Z', 'abc\n')
>>>
And what happens if the MULTILINE flag is turned on?
>>> re.match(r'abc$', 'abc\ndef', flags=re.MULTILINE)
<_sre.SRE_Match object at 0x00F15448>
>>> re.match(r'abc\Z', 'abc\ndef', flags=re.MULTILINE)
>>> |
|
Date |
User |
Action |
Args |
2012-10-12 19:45:41 | mrabarnett | set | recipients:
+ mrabarnett, gvanrossum, tim.peters, pitrou, serhiy.storchaka |
2012-10-12 19:45:41 | mrabarnett | set | messageid: <1350071141.83.0.637701466962.issue16203@psf.upfronthosting.co.za> |
2012-10-12 19:45:41 | mrabarnett | link | issue16203 messages |
2012-10-12 19:45:41 | mrabarnett | create | |
|