[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #27800: Merge RE repetition doc from 3.5 into 3.6

martin.panter python-checkins at python.org
Fri Oct 14 21:45:31 EDT 2016


https://hg.python.org/cpython/rev/1f2ca7e4b64e
changeset: 104501:1f2ca7e4b64e
branch: 3.6
parent: 104498:0837940bcb9f
parent: 104500:5f7d7e079e39
user: Martin Panter <vadmium+py at gmail.com>
date: Sat Oct 15 01:39:01 2016 +0000
summary:
 Issue #27800: Merge RE repetition doc from 3.5 into 3.6
files:
 Doc/library/re.rst | 6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -79,6 +79,12 @@
 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:
 
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /