File tree 1 file changed +12
-3
lines changed
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:
250
250
``[a\-z] ``) or if it's placed as the first or last character
251
251
(e.g. ``[-a] `` or ``[a-] ``), it will match a literal ``'-' ``.
252
252
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,
254
255
``[(+*)] `` will match any of the literal characters ``'(' ``, ``'+' ``,
255
256
``'*' ``, or ``')' ``.
256
257
257
258
.. index :: single: \ (backslash); in regular expressions
258
259
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.
261
270
262
271
.. index :: single: ^ (caret); in regular expressions
263
272
You can’t perform that action at this time.
0 commit comments