Skip to content

gh-91700: Validate the group number in conditional expression in RE#91702

Merged
serhiy-storchaka merged 1 commit intopython:mainfrom
serhiy-storchaka:re-groupref-exists
Apr 22, 2022
Merged

gh-91700: Validate the group number in conditional expression in RE#91702
serhiy-storchaka merged 1 commit intopython:mainfrom
serhiy-storchaka:re-groupref-exists

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 19, 2022

In expression (?(group)...) an appropriate re.error is now
raised if the group number refers to not defined group.

Previously it raised RuntimeError: invalid SRE code.

Closes #91700.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-regex type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal error when compile RE with conditional expression referring to not defined group

4 participants