[issue34873] re.finditer behaviour in re.MULTILINE mode fails to match first 7 characters

2018-10-02 Thread Tom Dawes


Tom Dawes  added the comment:

Please ignore, re.finditer and REGEX.finditer aren't the same. I was passing 
re.MULTILINE (= 8) to endPos.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue34873>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34873] re.finditer behaviour in re.MULTILINE mode fails to match first 7 characters

2018-10-02 Thread Tom Dawes


New submission from Tom Dawes :

re.finditer appears to fail to match within the first 7 characters in a string 
when re.MULTILINE is used:

>>> REGEX = re.compile("y")
>>> [list(m.start() for m in REGEX.finditer("{}y".format("x"*i), re.MULTILINE)) 
>>> for i in range(10)]
[[], [], [], [], [], [], [], [], [8], [9]]

Without re.MULTILINE, this works fine:

>>> [list(m.start() for m in REGEX.finditer("{}y".format("x"*i))) for i in 
>>> range(10)]
[[0], [1], [2], [3], [4], [5], [6], [7], [8], [9]]

Passing re.MULTILINE to re.compile doesn't seem to have any effect.

--
components: Regular Expressions
messages: 326911
nosy: ezio.melotti, mrabarnett, tdawes
priority: normal
severity: normal
status: open
title: re.finditer behaviour in re.MULTILINE mode fails to match first 7 
characters
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue34873>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com