Skip to content

Confusion in regular expression syntax example. #102259

@smontanaro

Description

@smontanaro

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions