summaryrefslogtreecommitdiffstats
path: root/Doc/library/re.rst
diff options
context:
space:
mode:
authorMark Summerfield <list@qtrac.plus.com>2008-05-31 13:05:34 (GMT)
committerMark Summerfield <list@qtrac.plus.com>2008-05-31 13:05:34 (GMT)
commit9e670c216164bd9e437ffefeba31fb0a7865b932 (patch)
treea92547d3a4075ae66f21a8ae7f3d924d393b3c07 /Doc/library/re.rst
parent1d138f1c1a37a630099b629cf42c0bbe46d1344b (diff)
downloadcpython-9e670c216164bd9e437ffefeba31fb0a7865b932.zip
cpython-9e670c216164bd9e437ffefeba31fb0a7865b932.tar.gz
cpython-9e670c216164bd9e437ffefeba31fb0a7865b932.tar.bz2
Added a note to [] that special forms & special chars lose their meaning
and backrefs can't be used inside []
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r--Doc/library/re.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 707eedf..5831364 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -181,6 +181,12 @@ The special characters are:
``[^5]`` will match any character except ``'5'``, and ``[^^]`` will match any
character except ``'^'``.
+ Note that inside ``[]`` the special forms and special characters lose
+ their meanings and only the syntaxes described here are valid. For
+ example, ``+``, ``*``, ``(``, ``)``, and so on are treated as
+ literals inside ``[]``, and backreferences cannot be used inside
+ ``[]``.
+
``'|'``
``A|B``, where A and B can be arbitrary REs, creates a regular expression that
will match either A or B. An arbitrary number of REs can be separated by the