[issue21593] Clarify re.search documentation first match
New submission from Joshua Landau: The documentation for re.search does not state that it returns the first match. This should be added, or a clarification added if this is implementation-defined. https://docs.python.org/3/library/re.html#re.search --- See also http://stackoverflow.com/questions/23906400/is-regular-expression-search-gua... ---------- assignee: docs@python components: Documentation messages: 219270 nosy: Joshua.Landau, docs@python priority: normal severity: normal status: open title: Clarify re.search documentation first match versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Terry J. Reedy added the comment: Since I am 99.999% sure that first is intended, I will change 'a location' to 'the first location'. ---------- assignee: docs@python -> terry.reedy nosy: +terry.reedy stage: -> needs patch type: -> enhancement versions: -Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Roundup Robot added the comment: New changeset f7bb1d73a341 by Terry Jan Reedy in branch '2.7': Issue #21593: (from StackOverflow) minor doc clarification for re.search. http://hg.python.org/cpython/rev/f7bb1d73a341 New changeset 6013a112aba0 by Terry Jan Reedy in branch '3.4': Issue #21593: (from StackOverflow) minor doc clarification for re.search. http://hg.python.org/cpython/rev/6013a112aba0 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Changes by Terry J. Reedy <tjreedy@udel.edu>: ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Joshua Landau added the comment: This should also be applied to regex.search's docstring. https://docs.python.org/3.5/library/re.html#re.regex.search ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Changes by Joshua Landau <joshua.landau.ws@gmail.com>: ---------- versions: +Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett stage: resolved -> commit review versions: -Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Roundup Robot added the comment: New changeset 48bb48e7499d by Berker Peksag in branch '3.5': Issue #21593: Clarify that re.search() returns the first match https://hg.python.org/cpython/rev/48bb48e7499d New changeset 243b95782059 by Berker Peksag in branch 'default': Issue #21593: Merge from 3.5 https://hg.python.org/cpython/rev/243b95782059 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
Berker Peksag added the comment:
This should also be applied to regex.search's docstring.
Done. ---------- nosy: +berker.peksag resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21593> _______________________________________
participants (5)
-
Berker Peksag
-
Ezio Melotti
-
Joshua Landau
-
Roundup Robot
-
Terry J. Reedy