Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ceafa7

Browse filesBrowse files
Add re.VERBOSE flag documentation example (#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.
1 parent 395b66a commit 0ceafa7
Copy full SHA for 0ceafa7

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎Doc/library/re.rst

Copy file name to clipboardExpand all lines: Doc/library/re.rst
+2-1Lines changed: 2 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.