Commit 71a0b438 authored by Zachary Ware's avatar Zachary Ware

Rewrite re.VERBOSE section.

It now has slightly better rationale and a less awkward wording in the
explanation.

Inspired by a report of a neither/or conflict by 'animalize' on docs@.
parent e1dc3d47
...@@ -548,13 +548,15 @@ form. ...@@ -548,13 +548,15 @@ form.
.. data:: X .. data:: X
VERBOSE VERBOSE
This flag allows you to write regular expressions that look nicer. Whitespace This flag allows you to write regular expressions that look nicer and are
within the pattern is ignored, except when in a character class or preceded by more readable by allowing you to visually separate logical sections of the
an unescaped backslash, and, when a line contains a ``'#'`` neither in a pattern and add comments. Whitespace within the pattern is ignored, except
character class or preceded by an unescaped backslash, all characters from the when in a character class or when preceded by an unescaped backslash.
leftmost such ``'#'`` through the end of the line are ignored. 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
That means that the two following regular expression objects that match a ``#`` through the end of the line are ignored.
This means that the two following regular expression objects that match a
decimal number are functionally equal:: decimal number are functionally equal::
a = re.compile(r"""\d + # the integral part a = re.compile(r"""\d + # the integral part
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment