Skip to content

Add example of named group to re.Match.__getitem__ doc #92727

Closed
@bmispelon

Description

@bmispelon

Documentation

The documentation for re.Match.__getitem__ only shows example of using positional capture groups (like matchobj[1]) but not named groups (like matchobj['foo']).

It mentions that "[...] is identical to m.group(g)" so you can infer that named groups work, but I think having an explicit example would encourage the adoption of the feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions