[Python-checkins] cpython (3.2): #14519: fix the regex used in the scanf example.
ezio.melotti
python-checkins at python.org
Sun Apr 29 10:49:03 CEST 2012
http://hg.python.org/cpython/rev/e317d651ccf8
changeset: 76625:e317d651ccf8
branch: 3.2
parent: 76621:2620641725bb
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Sun Apr 29 11:47:28 2012 +0300
summary:
#14519: fix the regex used in the scanf example.
files:
Doc/library/re.rst | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -1072,13 +1072,13 @@
+--------------------------------+---------------------------------------------+
| ``%i`` | ``[-+]?(0[xX][\dA-Fa-f]+|0[0-7]*|\d+)`` |
+--------------------------------+---------------------------------------------+
-| ``%o`` | ``0[0-7]*`` |
+| ``%o`` | ``[-+]?[0-7]+`` |
+--------------------------------+---------------------------------------------+
| ``%s`` | ``\S+`` |
+--------------------------------+---------------------------------------------+
| ``%u`` | ``\d+`` |
+--------------------------------+---------------------------------------------+
-| ``%x``, ``%X`` | ``0[xX][\dA-Fa-f]+`` |
+| ``%x``, ``%X`` | ``[-+]?(0[xX])?[\dA-Fa-f]+`` |
+--------------------------------+---------------------------------------------+
To extract the filename and numbers from a string like ::
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list