py.user <port...@yandex.ru> added the comment:

the multiline mode affects on regex.match()

>>> p = re.compile(r'^a')
>>> p.match('abc\nabc')
<_sre.SRE_Match object at 0xb749bf38>
>>> p.match('abc\nabc').span()
(0, 1)
>>> p.match('abc\nabc', 4)
>>> 
>>> p = re.compile(r'^a', re.M)
>>> p.match('abc\nabc', 4)
<_sre.SRE_Match object at 0xb749bf38>
>>> p.match('abc\nabc', 4).span()
(4, 5)
>>>

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14155>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to