[3.7] bpo-34294: re module, fix wrong capturing groups in rare cases. (GH-11546) by miss-islington · Pull Request #11919 · python/cpython

@miss-islington

…onGH-11546)

Need to reset capturing groups between two SRE(match) callings in loops, this fixes wrong capturing groups in rare cases.

Also add a missing index in re.rst.
(cherry picked from commit 4a7f44a)

Co-authored-by: animalize <animalize@users.noreply.github.com>

serhiy-storchaka