Use bracket access for re.Match groups

Proprietary

Replace match.group(n) with match[n] to use the shorter subscript syntax available since Python 3.6. It only fires where the receiver's type resolves to re.Match and the group is one positional argument.

org.openrewrite.python.cleanup.UseGetitemForReMatchGroups
mod run . --recipe=org.openrewrite.python.cleanup.UseGetitemForReMatchGroups

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.