[docs] possible bug in regular expression documentation
bart.aelterman at gmail.com
Fri Aug 2 12:06:49 CEST 2013
While reading the python documentation, chapter 7.2 "Regular expression
operations", I noticed a sentence that could be experienced as confusing:
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!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the docs