diff options
author | Mark Summerfield <list@qtrac.plus.com> | 2008-05-31 13:05:34 (GMT) |
---|---|---|
committer | Mark Summerfield <list@qtrac.plus.com> | 2008-05-31 13:05:34 (GMT) |
commit | 700a6350917ee6a6e760cb357723912588d1af5c (patch) | |
tree | 4f177ff12ecd0132e19a73ff440270757105fb4f | |
parent | 5bd88333ee233e2770942e9ffe26db0e83789048 (diff) | |
download | cpython-700a6350917ee6a6e760cb357723912588d1af5c.zip cpython-700a6350917ee6a6e760cb357723912588d1af5c.tar.gz cpython-700a6350917ee6a6e760cb357723912588d1af5c.tar.bz2 |
Added a note to [] that special forms & special chars lose their meaning
and backrefs can't be used inside []
-rw-r--r-- | Doc/library/re.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 270e551..05db89d 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 |