]> granicus.if.org Git - python/commitdiff
Rewrite re.VERBOSE section.
authorZachary Ware <zachary.ware@gmail.com>
Thu, 12 Nov 2015 05:32:14 +0000 (23:32 -0600)
committerZachary Ware <zachary.ware@gmail.com>
Thu, 12 Nov 2015 05:32:14 +0000 (23:32 -0600)
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@.

Doc/library/re.rst

index c3c8b65d8d925af9dd86f37cd60881df1e2b4e0d..cae687483358c3d1c0b347349e49b2b50a113117 100644 (file)
@@ -548,13 +548,15 @@ form.
 .. data:: X
           VERBOSE
 
-   This flag allows you to write regular expressions that look nicer. Whitespace
-   within the pattern is ignored, except when in a character class or preceded by
-   an unescaped backslash, and, when a line contains a ``'#'`` neither in a
-   character class or preceded by an unescaped backslash, all characters from the
-   leftmost such ``'#'`` through the end of the line are ignored.
-
-   That means that the two following regular expression objects that match a
+   This flag allows you to write regular expressions that look nicer and are
+   more readable by allowing you to visually separate logical sections of the
+   pattern and add comments. Whitespace within the pattern is ignored, except
+   when in a character class or when preceded by an unescaped backslash.
+   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
+   ``#`` 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::
 
       a = re.compile(r"""\d +  # the integral part