Skip to content

Commit

Permalink
[3.12] gh-102111: Add link to string escape sequences in re module (G…
Browse files Browse the repository at this point in the history
…H-106995) (#107096)

Co-authored-by: wulmer <wulmer@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
3 people authored Jul 23, 2023
1 parent d87d67b commit 52804b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ character ``'$'``.
single: \x; in regular expressions
single: \\; in regular expressions

Most of the standard escapes supported by Python string literals are also
accepted by the regular expression parser::
Most of the :ref:`escape sequences <escape-sequences>` supported by Python
string literals are also accepted by the regular expression parser::

\a \b \f \n
\N \r \t \u
Expand Down
4 changes: 4 additions & 0 deletions Doc/reference/lexical_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,10 @@ retained), except that three unescaped quotes in a row terminate the literal. (

.. _escape-sequences:


Escape sequences
^^^^^^^^^^^^^^^^

Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string and
bytes literals are interpreted according to rules similar to those used by
Standard C. The recognized escape sequences are:
Expand Down

0 comments on commit 52804b3

Please sign in to comment.