Skip to content

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

Open
miss-islington wants to merge 1 commit into
python:3.14from
miss-islington:backport-6b58f9a-3.14
Open

miss-islington wants to merge 1 commit 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 6b58f9a6a12a3c514a755e5e86dc9b9f36bacb9d)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants