File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -250,14 +250,23 @@ The special characters are:
250250 ``[a\-z] ``) or if it's placed as the first or last character
251251 (e.g. ``[-a] `` or ``[a-] ``), it will match a literal ``'-' ``.
252252
253- * Special characters lose their special meaning inside sets. For example,
253+ * Special characters except backslash lose their special meaning inside sets.
254+ For example,
254255 ``[(+*)] `` will match any of the literal characters ``'(' ``, ``'+' ``,
255256 ``'*' ``, or ``')' ``.
256257
257258 .. index :: single: \ (backslash); in regular expressions
258259
259- * Character classes such as ``\w `` or ``\S `` (defined below) are also accepted
260- inside a set, although the characters they match depend on the flags _ used.
260+ * Backslash either escapes characters which have special meaning in a set
261+ such as ``'-' ``, ``']' ``, ``'^' `` and ``'\\' `` itself or signals
262+ a special sequence which represents a single character such as
263+ ``\xa0 `` or ``\n `` or a character class such as ``\w `` or ``\S ``
264+ (defined below).
265+ Note that ``\b `` represents a single "backspace" character,
266+ not a word boundary as outside a set, and numeric escapes
267+ such as ``\1 `` are always octal escapes, not group references.
268+ Special sequences which do not match a single character such as ``\A ``
269+ and ``\Z `` are not allowed.
261270
262271 .. index :: single: ^ (caret); in regular expressions
263272
You can’t perform that action at this time.
0 commit comments