[issue30720] re.sub substitution match group contains wrong value after unmatched pattern was processed

William Budd report at bugs.python.org
Wed Jun 21 00:04:51 EDT 2017


William Budd added the comment:

I now see you're right of course. Not a bug after all. Thank you.

I mistakenly assumed that the group boundary ")" would delimit the end of the non-greedy match group. I.e., ".*?</p>" versus ".*?</p></div>".

I don't see a way to accomplish the "even less greedy" variant I'm looking for though...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30720>
_______________________________________


More information about the Python-bugs-list mailing list