summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-10-15 01:18:16 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-10-15 01:18:16 (GMT)
commit684340ede58776d77a104c689e821d1eab36bf63 (patch)
tree5b79ad98de861e79fcd5caa9e2aa75854ef1672c
parentc73e9d844fcc9e91eff5ff933336aa46005bdefc (diff)
downloadcpython-684340ede58776d77a104c689e821d1eab36bf63.zip
cpython-684340ede58776d77a104c689e821d1eab36bf63.tar.gz
cpython-684340ede58776d77a104c689e821d1eab36bf63.tar.bz2
Issue #27800: Document limitation and workaround for multiple RE repetitions
-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 569b522..1ca621e 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -79,6 +79,12 @@ how the regular expressions around them are interpreted. Regular
expression pattern strings may not contain null bytes, but can specify
the null byte using a ``\number`` notation such as ``'\x00'``.
+Repetition qualifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) cannot be
+directly nested. This avoids ambiguity with the non-greedy modifier suffix
+``?``, and with other modifiers in other implementations. To apply a second
+repetition to an inner repetition, parentheses may be used. For example,
+the expression ``(?:a{6})*`` matches any multiple of six ``'a'`` characters.
+
The special characters are: