Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ef6344 commit 3bacf61Copy full SHA for 3bacf61
1 file changed
Doc/howto/regex.rst
@@ -96,8 +96,9 @@ special nature.
96
97
You can match the characters not listed within the class by :dfn:`complementing`
98
the set. This is indicated by including a ``'^'`` as the first character of the
99
-class; ``'^'`` outside a character class will simply match the ``'^'``
100
-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.
101
+For example: ``[5^]`` will match either a ``'5'`` or a ``'^'``.
102
103
Perhaps the most important metacharacter is the backslash, ``\``. As in Python
104
string literals, the backslash can be followed by various characters to signal
0 commit comments