[docs] Regex documentation bug

Neta Oren netaoren19 at gmail.com
Thu May 19 04:35:34 EDT 2016


Hi,
I was reading your documentation page about regex, and noticed you had a
mistake.
The specific page is 'Regular Expression HOWTO -- Python 2.7.11
documentation'.
It is located in the address:
https://docs.python.org/2/howto/regex.html
The mistake is at the 'Performing Matches' section.
The mistake is:
You wrote that the start() and end() methods will retnot end the starting
and ending indices of the match. However in the example you provided the
end index is in fact the length of the match, and not the ending index
(that would be length - 1).
If the index starts at 0 and ends at 11 then that means there are 12
characters, however in your examples it was not as such.
This can create array out of bounds exceptions and other exceptions as well.
This error is repeated in this section several times.
For your attention,
Neta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20160519/6f566b53/attachment-0001.html>


More information about the docs mailing list