summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2015-11-12 05:32:14 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2015-11-12 05:32:14 (GMT)
commit71a0b43854164b6ada0026d90f241c987b54d019 (patch)
treefb322283420c23d6ef4ecc3b99d245a35c6697a7 /Doc
parente1dc3d47e0a5cc4b390cc9eb70c5a5153c309cb2 (diff)
downloadcpython-71a0b43854164b6ada0026d90f241c987b54d019.zip
cpython-71a0b43854164b6ada0026d90f241c987b54d019.tar.gz
cpython-71a0b43854164b6ada0026d90f241c987b54d019.tar.bz2
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@.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/re.rst16
1 files changed, 9 insertions, 7 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index c3c8b65..cae6874 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -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