Skip to content

Confusion in regular expression syntax example. #102259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
smontanaro opened this issue Feb 25, 2023 · 2 comments
Closed

Confusion in regular expression syntax example. #102259

smontanaro opened this issue Feb 25, 2023 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@smontanaro
Copy link
Contributor

smontanaro commented Feb 25, 2023

In the 3.11 documentation, the regular expression syntax section reads, in part:

To match a literal ']' inside a set, precede it with a backslash, or place it at the beginning of the set. For example, both [()[\]{}] and []()[{}] will both match a parenthesis.

The discussion centers on matching a right square bracket, but the end phrase reads, "... will both match a parenthesis." I suspect the author meant something like "... will both match left or right braces, parentheses or square brackets."

The same wording exists in 2.7 and 3.5 through 3.12. I doubt it's worth backporting beyond whatever is still being actively bugfixed.

Linked PRs

@smontanaro smontanaro added the docs Documentation in the Doc dir label Feb 25, 2023
@terryjreedy terryjreedy changed the title Typo in regular expression syntax documentation Confusion in regular expression syntax example. Feb 25, 2023
@terryjreedy
Copy link
Member

Thank you Skip. I have seen this anomaly but never stopped to open an issue. I propose to replace 'a parenthesis' with 'a right bracket, as well as left bracket, braces, and parentheses'. What do you think? If OK, can you make a PR and ask me to review?

Doc changes are usually backported to bugfix releases when applicable and easily done. Thank you for the note that both are true. They are almost never backported to security releases and then only by the release manager. (Prior releases are frozen ;-)

Use a single > to blockquote text. This results in proper wrapping instead of a horizontal scroll bar. The examples needed backticks to display properly.

@smontanaro
Copy link
Contributor Author

Sure, I'll whip something up. Thanks for the Markdown suggestion. I seem to always choose incorrectly between "code" and "quote".

terryjreedy added a commit that referenced this issue Feb 26, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 26, 2023
…thonGH-102264)

(cherry picked from commit bcadcde)

Co-authored-by: Skip Montanaro <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 26, 2023
…thonGH-102264)

(cherry picked from commit bcadcde)

Co-authored-by: Skip Montanaro <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this issue Feb 26, 2023
(cherry picked from commit bcadcde)

Co-authored-by: Skip Montanaro <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this issue Feb 26, 2023
(cherry picked from commit bcadcde)

Co-authored-by: Skip Montanaro <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants