From 684340ede58776d77a104c689e821d1eab36bf63 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Sat, 15 Oct 2016 01:18:16 +0000 Subject: [PATCH] Issue #27800: Document limitation and workaround for multiple RE repetitions --- Doc/library/re.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 569b5223323..1ca621eca6a 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: