# HG changeset patch # Parent e3dbe8b7279ad05ba04e3d6c71f318f740172f20 Issue #27800: Document limitation and workaround for multiple RE repetitions diff -r e3dbe8b7279a -r 3c8eaa518c81 Doc/library/re.rst --- a/Doc/library/re.rst Sat Sep 03 19:30:22 2016 +0100 +++ b/Doc/library/re.rst Sun Sep 04 06:46:56 2016 +0000 @@ -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: