Skip to content

gh-102111: Add link to string escape sequences in re module #106995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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