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.

Title: repr doesn't give full result for this re math result
Type: behavior Stage:
Components: Regular Expressions Versions: Python 3.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, iMath, mrabarnett, r.david.murray, redstone-cold
Priority: normal Keywords:

Created on 2016-12-26 12:41 by redstone-cold, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg284024 - (view) Author: iMath (redstone-cold) Date: 2016-12-26 12:41
I tested with Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32'*?\.html.+', '') 
does give a match, but it show the result 
<_sre.SRE_Match object; span=(0, 54), match='>
missing rc=P5' in IDLE

BTW, py2.7 works fine
msg284032 - (view) Author: Matthew Barnett (mrabarnett) * (Python triager) Date: 2016-12-26 15:43
See issue 17087: "Improve the repr for regular expression match objects".

It was decided that it might be a bad idea to show the entire matched portion of the string because it could be very long, so it's shown truncated if necessary.
msg284033 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-26 16:08
If it is truncated, should it end with '...' or [...]?
msg284058 - (view) Author: Philip Lee (iMath) Date: 2016-12-27 04:33
I think so, the current behavior is  misleading 

在2016年12月27 00时08分, "R. David Murray"<>写道:

R. David Murray added the comment:

If it is truncated, should it end with '...' or [...]?

nosy: +r.david.murray

Python tracker <>
msg284181 - (view) Author: Matthew Barnett (mrabarnett) * (Python triager) Date: 2016-12-28 16:23
Probably "...", although we also have to consider that the matched portion could in fact not be truncated but just happen to end with "...", although that would be a rare occurrence.
Date User Action Args
2022-04-11 14:58:41adminsetgithub: 73260
2016-12-28 16:23:03mrabarnettsetmessages: + msg284181
2016-12-27 04:33:55iMathsetnosy: + iMath
messages: + msg284058
2016-12-26 16:08:56r.david.murraysetnosy: + r.david.murray
messages: + msg284033
2016-12-26 15:43:14mrabarnettsetstatus: open -> closed
resolution: not a bug
messages: + msg284032
2016-12-26 12:41:55redstone-coldcreate