[docs] possible bug in regular expression documentation

Bart Aelterman bart.aelterman at gmail.com
Fri Aug 2 12:06:49 CEST 2013


Dear,

While reading the python documentation, chapter 7.2 "Regular expression
operations", I noticed a sentence that could be experienced as confusing:

"
\d
When the UNICODE flag is not specified, matches any decimal digit; this is
equivalent to the set [0-9]. With UNICODE, it will match whatever is
classified as a decimal digit in the Unicode character properties database.
"

I have a problem with "decimal digit". These patterns match only one
character. Therefore, one character can never be decimal, as that would
imply the presence of at least one digit and a decimal character (dot). I
would propose to delete the word "decimal". \d matches a digit.
Unless you want to say that \d+ matches a decimal digit, for instance
"2.2". But when I try that in ipython, \d+ only matches "2".

I hope my comment was helpful!

Thanks for all the great efforts!

Bart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20130802/c6ed7181/attachment.html>


More information about the docs mailing list