File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,9 @@ special nature.
101
101
102
102
You can match the characters not listed within the class by :dfn: `complementing `
103
103
the set. This is indicated by including a ``'^' `` as the first character of the
104
- class; ``'^' `` outside a character class will simply match the ``'^' ``
105
- character. For example, ``[^5] `` will match any character except ``'5' ``.
104
+ class. For example, ``[^5] `` will match any character except ``'5' ``. If the
105
+ caret appears elsewhere in a character class, it does not have special meaning.
106
+ For example: ``[5^] `` will match either a ``'5' `` or a ``'^' ``.
106
107
107
108
Perhaps the most important metacharacter is the backslash, ``\ ``. As in Python
108
109
string literals, the backslash can be followed by various characters to signal
You can’t perform that action at this time.
0 commit comments