Issue #6561: '\d' in a regular expression should match only Unicode

character category [Nd],  not [No].
This commit is contained in:
Mark Dickinson 2009-07-28 17:22:36 +00:00
parent 6bd13fbbc8
commit 1f268285ff
4 changed files with 32 additions and 6 deletions

View file

@ -338,11 +338,12 @@ the second character. For example, ``\$`` matches the character ``'$'``.
``\d``
For Unicode (str) patterns:
Matches any Unicode digit (which includes ``[0-9]``, and also many
other digit characters). If the :const:`ASCII` flag is used only
``[0-9]`` is matched (but the flag affects the entire regular
expression, so in such cases using an explicit ``[0-9]`` may be a
better choice).
Matches any Unicode decimal digit (that is, any character in
Unicode character category [Nd]). This includes ``[0-9]``, and
also many other digit characters. If the :const:`ASCII` flag is
used only ``[0-9]`` is matched (but the flag affects the entire
regular expression, so in such cases using an explicit ``[0-9]``
may be a better choice).
For 8-bit (bytes) patterns:
Matches any decimal digit; this is equivalent to ``[0-9]``.