[docs] [issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers

py.user report at bugs.python.org
Sun Apr 15 05:58:31 CEST 2012


py.user <bugzilla-mail-box at yandex.ru> added the comment:

the same problem in the %o analog

valid strings for the %x specifier of scanf():
"+0xabc"
"-0xabc"
"+abc"
"-abc"

valid strings for the %o specifier of scanf():
"+0123"
"-0123"
"+123"
"-123"

how to patch
the %x specifier:
0[xX][\dA-Fa-f]+   ->   [-+]?(0[xX])?[\dA-Fa-f]+
the %o specifier:
0[0-7]*            ->   [-+]?[0-7]+

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14519>
_______________________________________


More information about the docs mailing list