Skip to content

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

Closed

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

Activity

  1. added
    docs
    on Feb 8, 2023
  2. added a commit that references this issue on Feb 17, 2024
  3. added 2 commits that reference this issue on Feb 17, 2024
  4. added 2 commits that reference this issue on Feb 17, 2024
  5. added a commit that references this issue on Mar 4, 2024
  6. added a commit that references this issue on Apr 17, 2024
  7. added a commit that references this issue on Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docstopic-regex

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions