From f0b348102b1b6d6899a262d330ad4151b1e64961 Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Thu, 19 Feb 2026 21:41:03 -0500 Subject: [PATCH 1/2] [regex] Update to 2026.2.19 --- stubs/regex/METADATA.toml | 2 +- stubs/regex/regex/__init__.pyi | 1 + stubs/regex/regex/_main.pyi | 47 ++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/stubs/regex/METADATA.toml b/stubs/regex/METADATA.toml index f6ea05fab5b1..b3ff72589f4b 100644 --- a/stubs/regex/METADATA.toml +++ b/stubs/regex/METADATA.toml @@ -1,2 +1,2 @@ -version = "2026.1.15" +version = "2026.2.19" upstream_repository = "https://github.com/mrabarnett/mrab-regex" diff --git a/stubs/regex/regex/__init__.pyi b/stubs/regex/regex/__init__.pyi index 92e7589d0181..d6f58927e4df 100644 --- a/stubs/regex/regex/__init__.pyi +++ b/stubs/regex/regex/__init__.pyi @@ -10,6 +10,7 @@ __all__ = [ "finditer", "fullmatch", "match", + "prefixmatch", "purge", "search", "split", diff --git a/stubs/regex/regex/_main.pyi b/stubs/regex/regex/_main.pyi index a37774c6ebde..f1fe77cfac12 100644 --- a/stubs/regex/regex/_main.pyi +++ b/stubs/regex/regex/_main.pyi @@ -21,6 +21,7 @@ __all__ = [ "finditer", "fullmatch", "match", + "prefixmatch", "purge", "search", "split", @@ -134,6 +135,32 @@ def match( **kwargs: Any, ) -> Match[bytes] | None: ... @overload +def prefixmatch( + pattern: str | Pattern[str], + string: str, + flags: int = 0, + pos: int | None = None, + endpos: int | None = None, + partial: bool = False, + concurrent: bool | None = None, + timeout: float | None = None, + ignore_unused: bool = False, + **kwargs: Any, +) -> Match[str] | None: ... +@overload +def prefixmatch( + pattern: bytes | Pattern[bytes], + string: ReadableBuffer, + flags: int = 0, + pos: int | None = None, + endpos: int | None = None, + partial: bool = False, + concurrent: bool | None = None, + timeout: float | None = None, + ignore_unused: bool = False, + **kwargs: Any, +) -> Match[bytes] | None: ... +@overload def fullmatch( pattern: str | Pattern[str], string: str, @@ -435,6 +462,26 @@ class Pattern(Generic[AnyStr]): timeout: float | None = None, ) -> Match[bytes] | None: ... @overload + def prefixmatch( + self: Pattern[str], + string: str, + pos: int | None = None, + endpos: int | None = None, + concurrent: bool | None = None, + partial: bool = False, + timeout: float | None = None, + ) -> Match[str] | None: ... + @overload + def prefixmatch( + self: Pattern[bytes], + string: ReadableBuffer, + pos: int | None = None, + endpos: int | None = None, + concurrent: bool | None = None, + partial: bool = False, + timeout: float | None = None, + ) -> Match[bytes] | None: ... + @overload def fullmatch( self: Pattern[str], string: str, From c2316b6cb3f68bf3ea459ef38dbadf89740ebfb2 Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Thu, 19 Feb 2026 22:48:51 -0500 Subject: [PATCH 2/2] prefixmatch = match --- stubs/regex/regex/_main.pyi | 50 +++---------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/stubs/regex/regex/_main.pyi b/stubs/regex/regex/_main.pyi index f1fe77cfac12..49c66bb0248c 100644 --- a/stubs/regex/regex/_main.pyi +++ b/stubs/regex/regex/_main.pyi @@ -134,32 +134,9 @@ def match( ignore_unused: bool = False, **kwargs: Any, ) -> Match[bytes] | None: ... -@overload -def prefixmatch( - pattern: str | Pattern[str], - string: str, - flags: int = 0, - pos: int | None = None, - endpos: int | None = None, - partial: bool = False, - concurrent: bool | None = None, - timeout: float | None = None, - ignore_unused: bool = False, - **kwargs: Any, -) -> Match[str] | None: ... -@overload -def prefixmatch( - pattern: bytes | Pattern[bytes], - string: ReadableBuffer, - flags: int = 0, - pos: int | None = None, - endpos: int | None = None, - partial: bool = False, - concurrent: bool | None = None, - timeout: float | None = None, - ignore_unused: bool = False, - **kwargs: Any, -) -> Match[bytes] | None: ... + +prefixmatch = match + @overload def fullmatch( pattern: str | Pattern[str], @@ -461,26 +438,7 @@ class Pattern(Generic[AnyStr]): partial: bool = False, timeout: float | None = None, ) -> Match[bytes] | None: ... - @overload - def prefixmatch( - self: Pattern[str], - string: str, - pos: int | None = None, - endpos: int | None = None, - concurrent: bool | None = None, - partial: bool = False, - timeout: float | None = None, - ) -> Match[str] | None: ... - @overload - def prefixmatch( - self: Pattern[bytes], - string: ReadableBuffer, - pos: int | None = None, - endpos: int | None = None, - concurrent: bool | None = None, - partial: bool = False, - timeout: float | None = None, - ) -> Match[bytes] | None: ... + prefixmatch = match @overload def fullmatch( self: Pattern[str],