Issue 21593: Clarify re.search documentation first match (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/65792

classification

Title: Clarify re.search documentation first match
Type: enhancement Stage: resolved
Components: Documentation, Regular Expressions Versions: Python 3.6, Python 3.5, Python 2.7

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: Joshua.Landau, berker.peksag, docs@python, ezio.melotti, mrabarnett, python-dev, terry.reedy
Priority: normal Keywords:

Created on 2014-05-28 14:39 by Joshua.Landau, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg219270 - (view) Author: Joshua Landau (Joshua.Landau) * Date: 2014-05-28 14:39
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-guaranteed-to-return-first-match
msg219420 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-05-30 19:51
Since I am 99.999% sure that first is intended, I will change 'a location' to 'the first location'.
msg219426 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-30 20:20
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
msg243187 - (view) Author: Joshua Landau (Joshua.Landau) * Date: 2015-05-14 12:47
This should also be applied to regex.search's docstring. https://docs.python.org/3.5/library/re.html#re.regex.search
msg267838 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-08 11:57
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
msg267839 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-06-08 11:58
> This should also be applied to regex.search's docstring. Done.
History
Date User Action Args
2022-04-11 14:58:04 admin set github: 65792
2016-06-08 11:58:29 berker.peksag set status: open -> closednosy: + berker.peksagmessages: + resolution: fixedstage: commit review -> resolved
2016-06-08 11:57:40 python-dev set messages: +
2016-01-03 10:16:53 ezio.melotti set nosy: + ezio.melotti, mrabarnettstage: resolved -> commit reviewcomponents: + Regular Expressionsversions: - Python 3.4
2015-10-23 13🔞16 Joshua.Landau set versions: + Python 3.6
2015-05-14 12:47:21 Joshua.Landau set status: closed -> openresolution: fixed -> (no value)messages: +
2014-05-31 00:13:26 terry.reedy set status: open -> closedresolution: fixedstage: needs patch -> resolved
2014-05-30 20:20:52 python-dev set nosy: + python-devmessages: +
2014-05-30 19:51:50 terry.reedy set assignee: docs@python -> terry.reedytype: enhancementversions: - Python 3.1, Python 3.2, Python 3.3nosy: + terry.reedymessages: + stage: needs patch
2014-05-28 14:39:26 Joshua.Landau create