Add re.VERBOSE flag documentation example (GH-97678)

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.
(cherry picked from commit 0ceafa7fa4)

Co-authored-by: Athos Ribeiro <athoscribeiro@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-10-04 18:29:54 -07:00 committed by GitHub
parent d03f45203b
commit 0151375829
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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