Skip to content

(outdated) gh-101699: Explain using Match.expand with \g<0> - #101475

Closed
Stevoisiak wants to merge 2 commits into
python:3.11from
Stevoisiak:patch-2
Closed

Stevoisiak wants to merge 2 commits into
python:3.11from
Stevoisiak:patch-2

Conversation

@Stevoisiak

@Stevoisiak Stevoisiak commented Jan 31, 2023 •

Copy link
Copy Markdown
Contributor

Update documentation for re library to explain that a backreference to group0 (\g<0>) is expanded to the entire string when using Match.expand(). Note that numeric backreferences to group 0 (\0) are not supported. (See https://stackoverflow.com/q/58134893/3357935)

An issue number was not included since this diff only changes documentation without modifying code.

Explain that a named backreference to group0 (`\g<0>`) is expanded to the entire string when using `Match.expand()`. Note that numeric backreferences to group 0 (`\0`) are not supported. (See https://stackoverflow.com/questions/58134893/why-doesnt-0-work-in-python-regexp-substitutions-i-e-with-sub-or-expand)
@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Jan 31, 2023
@Stevoisiak Stevoisiak changed the title Documentation: Explain using Match.expand with \g<0> gh-101699: Explain using Match.expand with \g<0> Feb 8, 2023
@arhadthedev

arhadthedev commented Feb 8, 2023 •

Copy link
Copy Markdown
Member

It seems you accidentally removed your branch by mistake thus autoclosing the PR.

@Stevoisiak

Copy link
Copy Markdown
Contributor Author

It seems you accidentally removed your branch by mistake thus autoclosing the PR.

I renamed the branch to give it a more descriptive name. Apparently this closed the pull request instead of updating the branch.

@Stevoisiak
Stevoisiak restored the patch-2 branch February 8, 2023 18:11
@Stevoisiak

Stevoisiak commented Feb 8, 2023 •

Copy link
Copy Markdown
Contributor Author

@arhadthedev Since renaming the branch for the existing PR isn't working, should I make a new pull request with the updated branch name?

@arhadthedev

Copy link
Copy Markdown
Member

Would that be acceptable

Absolutely no problem. By the way, GitHub is limited in branch recovery (we already call to recrete PRs that target a wrong branch, for example).

@Stevoisiak Stevoisiak changed the title gh-101699: Explain using Match.expand with \g<0> (outdated) gh-101699: Explain using Match.expand with \g<0> Feb 8, 2023
@Stevoisiak
Stevoisiak deleted the patch-2 branch February 8, 2023 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants