]> granicus.if.org Git - python/commitdiff
#14519: fix the regex used in the scanf example.
authorEzio Melotti <ezio.melotti@gmail.com>
Sun, 29 Apr 2012 08:47:28 +0000 (11:47 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Sun, 29 Apr 2012 08:47:28 +0000 (11:47 +0300)
Doc/library/re.rst

index 56e605772b6ddac7d9bf2d0be4d2eddc44e6c785..e6e20d62d2be79b0e5e4bd64d5f9a3dbbd42225c 100644 (file)
@@ -1058,13 +1058,13 @@ expressions.
 +--------------------------------+---------------------------------------------+
 | ``%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 ::