Skip to content

re.search yields incorrect result (lib* matches linux) #150304

@justarrow

Description

@justarrow

Bug description:

re.search("lib*", "linux-generic") gets a match, running on Python 3.13.7
EDIT: re.search("linux*, ...) works as expected

from re import search

SEARCH = "lib*" 

print(search(SEARCH, "liblcms2-utils"))  # <re.Match object; span=(0, 3), match='lib'>
print(search(SEARCH, "linux-generic"))   # <re.Match object; span=(0, 2), match='li'>

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions