8000 bpo-35584: Clarify role of caret in a class class by rhettinger · Pull Request #11946 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-35584: Clarify role of caret in a class class #11946

8000
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

Merged
merged 1 commit into from
Feb 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Doc/howto/regex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ special nature.

You can match the characters not listed within the class by :dfn:`complementing`
the set. This is indicated by including a ``'^'`` as the first character of the
class; ``'^'`` outside a character class will simply match the ``'^'``
character. For example, ``[^5]`` will match any character except ``'5'``.
class. For example, ``[^5]`` will match any character except ``'5'``. If the
caret appears elsewhere in a character class, it does not have special meaning.
For example: ``[5^]`` will match either a ``'5'`` or a ``'^'``.

Perhaps the most important metacharacter is the backslash, ``\``. As in Python
string literals, the backslash can be followed by various characters to signal
Expand Down
0