Ned Deily added the comment: To expand a bit, rather than multiple calls to search, you can use the start and end methods of the match object to determine where the string (without the '^' anchor) matches. For example:
r = re.compile("abc") s = "0123abcxyz" match = r.search(s) if match: print(match.start(), match.end()) ---------- _______________________________________ 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