Skip to content

Match.expand doesn't document replacement of group 0 #101699

@Stevoisiak

Description

@Stevoisiak

Documentation

The documentation for Match.expand() does not specify that you can use a named backreference to group 0 (\g<0>) to reference the entire matching string.

Note that unlike Match.group(), a numeric backreference to group 0 (\0) will not be replaced. This inconsistent behavior has lead to some confusion.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions