]> granicus.if.org Git - python/commitdiff
Issue #27800: Document limitation and workaround for multiple RE repetitions
authorMartin Panter <vadmium+py@gmail.com>
Sat, 15 Oct 2016 01:18:16 +0000 (01:18 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sat, 15 Oct 2016 01:18:16 +0000 (01:18 +0000)
Doc/library/re.rst

index 123943474d434fd8f8d0af15986646555f2b3c2a..7b76d0c47d2e7ec453c036311261143e5391623d 100644 (file)
@@ -70,6 +70,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 the ``\number`` notation, e.g., ``'\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: