Message179118
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()) |
|
Date |
User |
Action |
Args |
2013-01-05 10:22:02 | ned.deily | set | recipients:
+ ned.deily, ezio.melotti, mrabarnett, bsdphk |
2013-01-05 10:22:02 | ned.deily | set | messageid: <1357381322.45.0.518067086588.issue16870@psf.upfronthosting.co.za> |
2013-01-05 10:22:02 | ned.deily | link | issue16870 messages |
2013-01-05 10:22:02 | ned.deily | create | |
|