This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ned.deily
Recipients bsdphk, ezio.melotti, mrabarnett, ned.deily
Date 2013-01-05.10:22:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357381322.45.0.518067086588.issue16870@psf.upfronthosting.co.za>
In-reply-to
Content
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())
History
Date User Action Args
2013-01-05 10:22:02ned.deilysetrecipients: + ned.deily, ezio.melotti, mrabarnett, bsdphk
2013-01-05 10:22:02ned.deilysetmessageid: <1357381322.45.0.518067086588.issue16870@psf.upfronthosting.co.za>
2013-01-05 10:22:02ned.deilylinkissue16870 messages
2013-01-05 10:22:02ned.deilycreate