[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:50:57 EDT 2017


William Budd added the comment:

Doh! This has a really easy solution, doesn't it; just replace "." with "[^<]": re.compile('<div>(<p>[^<]*?</p>)</div>', flags=re.DOTALL).

Sorry about the noise.

----------

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


More information about the Python-bugs-list mailing list