Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5861f53

Browse files
committed
Add re.VERBOSE flag documentation example
The current re.VERBOSE documentation example leaves space for ambiguous interpretation. One may read that spaces within the `(?:` token are spaces inside the non-capturing group (such as `(?: )`). This patch removes the ambiguity by including examples after the statement.
1 parent 9fbfa42 commit 5861f53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/re.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,8 @@ Flags
783783
more readable by allowing you to visually separate logical sections of the
784784
pattern and add comments. Whitespace within the pattern is ignored, except
785785
when in a character class, or when preceded by an unescaped backslash,
786-
or within tokens like ``*?``, ``(?:`` or ``(?P<...>``.
786+
or within tokens like ``*?``, ``(?:`` or ``(?P<...>``. For example, ``(? :``
787+
and ``* ?`` are not allowed.
787788
When a line contains a ``#`` that is not in a character class and is not
788789
preceded by an unescaped backslash, all characters from the leftmost such
789790
``#`` through the end of the line are ignored.

0 commit comments

Comments
 (0)