mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
[regex] Update to 2025.10.23 (#14908)
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
# TODO: missing from stub
|
||||
regex.__all__
|
||||
regex._regex_core.__all__
|
||||
regex.regex.__all__
|
||||
|
||||
# Not exported in C modules:
|
||||
regex._regex.Splitter
|
||||
regex._regex.Scanner
|
||||
@@ -18,6 +13,3 @@ regex._regex.get_properties
|
||||
regex._regex.has_property_value
|
||||
regex._regex.CODE_SIZE
|
||||
regex._regex.MAGIC
|
||||
|
||||
# Tests:
|
||||
regex.test_regex
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = "2025.9.18"
|
||||
version = "2025.10.23"
|
||||
upstream_repository = "https://github.com/mrabarnett/mrab-regex"
|
||||
|
||||
@@ -1 +1,64 @@
|
||||
from .regex import *
|
||||
from ._main import *
|
||||
|
||||
# Sync with regex._main.__all__
|
||||
__all__ = [
|
||||
"cache_all",
|
||||
"compile",
|
||||
"DEFAULT_VERSION",
|
||||
"escape",
|
||||
"findall",
|
||||
"finditer",
|
||||
"fullmatch",
|
||||
"match",
|
||||
"purge",
|
||||
"search",
|
||||
"split",
|
||||
"splititer",
|
||||
"sub",
|
||||
"subf",
|
||||
"subfn",
|
||||
"subn",
|
||||
"template",
|
||||
"Scanner",
|
||||
"A",
|
||||
"ASCII",
|
||||
"B",
|
||||
"BESTMATCH",
|
||||
"D",
|
||||
"DEBUG",
|
||||
"E",
|
||||
"ENHANCEMATCH",
|
||||
"S",
|
||||
"DOTALL",
|
||||
"F",
|
||||
"FULLCASE",
|
||||
"I",
|
||||
"IGNORECASE",
|
||||
"L",
|
||||
"LOCALE",
|
||||
"M",
|
||||
"MULTILINE",
|
||||
"P",
|
||||
"POSIX",
|
||||
"R",
|
||||
"REVERSE",
|
||||
"T",
|
||||
"TEMPLATE",
|
||||
"U",
|
||||
"UNICODE",
|
||||
"V0",
|
||||
"VERSION0",
|
||||
"V1",
|
||||
"VERSION1",
|
||||
"X",
|
||||
"VERBOSE",
|
||||
"W",
|
||||
"WORD",
|
||||
"error",
|
||||
"Regex",
|
||||
"__version__",
|
||||
"__doc__",
|
||||
"RegexFlag",
|
||||
"Pattern",
|
||||
"Match",
|
||||
]
|
||||
|
||||
@@ -11,6 +11,69 @@ _T = TypeVar("_T")
|
||||
|
||||
__version__: str
|
||||
|
||||
# Sync with regex.__init__.__all__
|
||||
__all__ = [
|
||||
"cache_all",
|
||||
"compile",
|
||||
"DEFAULT_VERSION",
|
||||
"escape",
|
||||
"findall",
|
||||
"finditer",
|
||||
"fullmatch",
|
||||
"match",
|
||||
"purge",
|
||||
"search",
|
||||
"split",
|
||||
"splititer",
|
||||
"sub",
|
||||
"subf",
|
||||
"subfn",
|
||||
"subn",
|
||||
"template",
|
||||
"Scanner",
|
||||
"A",
|
||||
"ASCII",
|
||||
"B",
|
||||
"BESTMATCH",
|
||||
"D",
|
||||
"DEBUG",
|
||||
"E",
|
||||
"ENHANCEMATCH",
|
||||
"S",
|
||||
"DOTALL",
|
||||
"F",
|
||||
"FULLCASE",
|
||||
"I",
|
||||
"IGNORECASE",
|
||||
"L",
|
||||
"LOCALE",
|
||||
"M",
|
||||
"MULTILINE",
|
||||
"P",
|
||||
"POSIX",
|
||||
"R",
|
||||
"REVERSE",
|
||||
"T",
|
||||
"TEMPLATE",
|
||||
"U",
|
||||
"UNICODE",
|
||||
"V0",
|
||||
"VERSION0",
|
||||
"V1",
|
||||
"VERSION1",
|
||||
"X",
|
||||
"VERBOSE",
|
||||
"W",
|
||||
"WORD",
|
||||
"error",
|
||||
"Regex",
|
||||
"__version__",
|
||||
"__doc__",
|
||||
"RegexFlag",
|
||||
"Pattern",
|
||||
"Match",
|
||||
]
|
||||
|
||||
def compile(
|
||||
pattern: AnyStr | Pattern[AnyStr],
|
||||
flags: int = 0,
|
||||
@@ -312,6 +375,9 @@ def cache_all(value: bool = True) -> None: ...
|
||||
@overload
|
||||
def cache_all(value: None) -> bool: ...
|
||||
def escape(pattern: AnyStr, special_only: bool = True, literal_spaces: bool = False) -> AnyStr: ...
|
||||
|
||||
DEFAULT_VERSION = RegexFlag.VERSION0
|
||||
|
||||
def template(pattern: AnyStr | Pattern[AnyStr], flags: int = 0) -> Pattern[AnyStr]: ...
|
||||
|
||||
Regex = compile
|
||||
@@ -6,7 +6,7 @@
|
||||
from typing import Any, AnyStr, Generic, final
|
||||
from typing_extensions import Self
|
||||
|
||||
from .regex import Match, Pattern
|
||||
from ._main import Match, Pattern
|
||||
|
||||
@final
|
||||
class Splitter(Generic[AnyStr]):
|
||||
|
||||
@@ -3,7 +3,47 @@ from collections.abc import Callable
|
||||
from typing import Any, AnyStr, Generic
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from .regex import Pattern
|
||||
from ._main import Pattern
|
||||
|
||||
__all__ = [
|
||||
"A",
|
||||
"ASCII",
|
||||
"B",
|
||||
"BESTMATCH",
|
||||
"D",
|
||||
"DEBUG",
|
||||
"E",
|
||||
"ENHANCEMATCH",
|
||||
"F",
|
||||
"FULLCASE",
|
||||
"I",
|
||||
"IGNORECASE",
|
||||
"L",
|
||||
"LOCALE",
|
||||
"M",
|
||||
"MULTILINE",
|
||||
"P",
|
||||
"POSIX",
|
||||
"R",
|
||||
"REVERSE",
|
||||
"S",
|
||||
"DOTALL",
|
||||
"T",
|
||||
"TEMPLATE",
|
||||
"U",
|
||||
"UNICODE",
|
||||
"V0",
|
||||
"VERSION0",
|
||||
"V1",
|
||||
"VERSION1",
|
||||
"W",
|
||||
"WORD",
|
||||
"X",
|
||||
"VERBOSE",
|
||||
"error",
|
||||
"Scanner",
|
||||
"RegexFlag",
|
||||
]
|
||||
|
||||
class error(Exception):
|
||||
def __init__(self, message: str, pattern: AnyStr | None = None, pos: int | None = None) -> None: ...
|
||||
@@ -44,42 +84,42 @@ class RegexFlag(enum.IntFlag):
|
||||
X = 0x40
|
||||
VERBOSE = X
|
||||
|
||||
A = RegexFlag.A
|
||||
ASCII = RegexFlag.ASCII
|
||||
B = RegexFlag.B
|
||||
BESTMATCH = RegexFlag.BESTMATCH
|
||||
D = RegexFlag.D
|
||||
DEBUG = RegexFlag.DEBUG
|
||||
E = RegexFlag.E
|
||||
ENHANCEMATCH = RegexFlag.ENHANCEMATCH
|
||||
F = RegexFlag.F
|
||||
FULLCASE = RegexFlag.FULLCASE
|
||||
I = RegexFlag.I
|
||||
IGNORECASE = RegexFlag.IGNORECASE
|
||||
L = RegexFlag.L
|
||||
LOCALE = RegexFlag.LOCALE
|
||||
M = RegexFlag.M
|
||||
MULTILINE = RegexFlag.MULTILINE
|
||||
P = RegexFlag.P
|
||||
POSIX = RegexFlag.POSIX
|
||||
R = RegexFlag.R
|
||||
REVERSE = RegexFlag.REVERSE
|
||||
T = RegexFlag.T
|
||||
TEMPLATE = RegexFlag.TEMPLATE
|
||||
S = RegexFlag.S
|
||||
DOTALL = RegexFlag.DOTALL
|
||||
U = RegexFlag.U
|
||||
UNICODE = RegexFlag.UNICODE
|
||||
V0 = RegexFlag.V0
|
||||
VERSION0 = RegexFlag.VERSION0
|
||||
V1 = RegexFlag.V1
|
||||
VERSION1 = RegexFlag.VERSION1
|
||||
W = RegexFlag.W
|
||||
WORD = RegexFlag.WORD
|
||||
X = RegexFlag.X
|
||||
VERBOSE = RegexFlag.VERBOSE
|
||||
VERSION0 = RegexFlag.VERSION0
|
||||
VERSION1 = RegexFlag.VERSION1
|
||||
WORD = RegexFlag.WORD
|
||||
A = RegexFlag.A
|
||||
B = RegexFlag.B
|
||||
D = RegexFlag.D
|
||||
E = RegexFlag.E
|
||||
F = RegexFlag.F
|
||||
I = RegexFlag.I
|
||||
L = RegexFlag.L
|
||||
M = RegexFlag.M
|
||||
P = RegexFlag.P
|
||||
R = RegexFlag.R
|
||||
S = RegexFlag.S
|
||||
U = RegexFlag.U
|
||||
V0 = RegexFlag.V0
|
||||
V1 = RegexFlag.V1
|
||||
W = RegexFlag.W
|
||||
X = RegexFlag.X
|
||||
T = RegexFlag.T
|
||||
|
||||
DEFAULT_VERSION: RegexFlag
|
||||
DEFAULT_VERSION = VERSION1
|
||||
|
||||
_Lexicon: TypeAlias = list[tuple[AnyStr, Callable[[Scanner[AnyStr], AnyStr], Any]]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user