Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0b1d1e

Browse files
committed
#14519: fix the regex used in the scanf example.
1 parent b8e336b commit a0b1d1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/re.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,13 +1072,13 @@ expressions.
10721072
+--------------------------------+---------------------------------------------+
10731073
| ``%i`` | ``[-+]?(0[xX][\dA-Fa-f]+|0[0-7]*|\d+)`` |
10741074
+--------------------------------+---------------------------------------------+
1075-
| ``%o`` | ``0[0-7]*`` |
1075+
| ``%o`` | ``[-+]?[0-7]+`` |
10761076
+--------------------------------+---------------------------------------------+
10771077
| ``%s`` | ``\S+`` |
10781078
+--------------------------------+---------------------------------------------+
10791079
| ``%u`` | ``\d+`` |
10801080
+--------------------------------+---------------------------------------------+
1081-
| ``%x``, ``%X`` | ``0[xX][\dA-Fa-f]+`` |
1081+
| ``%x``, ``%X`` | ``[-+]?(0[xX])?[\dA-Fa-f]+`` |
10821082
+--------------------------------+---------------------------------------------+
10831083

10841084
To extract the filename and numbers from a string like ::

0 commit comments

Comments
 (0)