New submission from Poul-Henning Kamp:

I'm surprised that this does not find any matches:

    import re
    r = re.compile("^abc")
    s = "0123abcxyz"
    for i in range(0,len(s)):
        print(i, r.search(s, i))

I would have expected the i==4 case to match ?

(This is on:
Python 2.7.3 (default, Dec 14 2012, 02:46:02) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.2 (branches/release_32 168974)] on 
freebsd10
)

----------
components: Regular Expressions
messages: 179116
nosy: bsdphk, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re fails to match ^ when start index is specified ?
versions: Python 2.7

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

Reply via email to