summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-23 08:59:16 (GMT)
committerGitHub <noreply@github.com>2023-07-23 08:59:16 (GMT)
commit52804b38016d304754e3fc6fcfbb69d761176f00 (patch)
treef7605ee1ff5b77c6cc65248096641596fe8058c4
parentd87d67b9e65c38dd6d1d378a5c013eccf50756f1 (diff)
downloadcpython-52804b38016d304754e3fc6fcfbb69d761176f00.zip
cpython-52804b38016d304754e3fc6fcfbb69d761176f00.tar.gz
cpython-52804b38016d304754e3fc6fcfbb69d761176f00.tar.bz2
[3.12] gh-102111: Add link to string escape sequences in re module (GH-106995) (#107096)
Co-authored-by: wulmer <wulmer@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
-rw-r--r--Doc/library/re.rst4
-rw-r--r--Doc/reference/lexical_analysis.rst4
2 files changed, 6 insertions, 2 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 629ee47..3f03f03 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -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
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 47062f8..dde7ba1 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -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: