From: Martin Panter Date: Sat, 15 Oct 2016 01:18:16 +0000 (+0000) Subject: Issue #27800: Document limitation and workaround for multiple RE repetitions X-Git-Tag: v2.7.13rc1~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=197332ae5a9d4885806b5cceafef650c4e8f8b77;p=python Issue #27800: Document limitation and workaround for multiple RE repetitions --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 123943474d..7b76d0c47d 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -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: