Skip to content

[3.14] gh-160316: Make re.Pattern.match() return None when pos > endpos (GH-160317) - #161044

Merged
gpshead merged 3 commits into
python:3.14from
miss-islington:backport-6b58f9a-3.14
Nov 2, 2026
Merged

gpshead merged 3 commits into
python:3.14from
miss-islington:backport-6b58f9a-3.14

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

gh-160316: Make re.Pattern.match() return None when pos > endpos

Pattern.match(), prefixmatch(), fullmatch() and the scanner match() ran
the engine with the start position past the end position, which could
return an empty match or read past the end of the string.

ANT-2026-NMTUWIC8
(cherry picked from commit 6b58f9a)

Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com

…endpos` (pythonGH-160317)

pythongh-160316: Make re.Pattern.match() return None when pos > endpos

Pattern.match(), prefixmatch(), fullmatch() and the scanner match() ran
the engine with the start position past the end position, which could
return an empty match or read past the end of the string.

ANT-2026-NMTUWIC8
(cherry picked from commit 6b58f9a)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@gpshead
gpshead disabled auto-merge November 1, 2026 22:50
@gpshead
gpshead enabled auto-merge (squash) November 1, 2026 22:50
@gpshead gpshead self-assigned this Nov 1, 2026
@gpshead
gpshead merged commit af2851a into python:3.14 Nov 2, 2026
52 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Sprint Nov 2, 2026
@miss-islington
miss-islington deleted the backport-6b58f9a-3.14 branch November 2, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants