Skip to content

Regex partial fullmatch fails on negative lookeahead #139798

@Shoooooon

Description

@Shoooooon

Bug report

Bug description:

The regex.fullmatch method has incorrect behavior when the partial flag is set and the regex uses negative lookahead:

import regex

a = regex.compile(r"(?!(True|False)\b)(.*)")

print(a.fullmatch("True", partial=True))
# Should produce a match (since "True" is a prefix of the match "Truest") but does not.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions