Skip to content

Commit cbd732e

Browse files
authored
[regex] Update to 2025.10.23 (#14908)
1 parent a205439 commit cbd732e

File tree

6 files changed

+191
-30
lines changed

6 files changed

+191
-30
lines changed
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# TODO: missing from stub
2-
regex.__all__
3-
regex._regex_core.__all__
4-
regex.regex.__all__
5-
61
# Not exported in C modules:
72
regex._regex.Splitter
83
regex._regex.Scanner
@@ -18,6 +13,3 @@ regex._regex.get_properties
1813
regex._regex.has_property_value
1914
regex._regex.CODE_SIZE
2015
regex._regex.MAGIC
21-
22-
# Tests:
23-
regex.test_regex

stubs/regex/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "2025.9.18"
1+
version = "2025.10.23"
22
upstream_repository = "https://github.com/mrabarnett/mrab-regex"

stubs/regex/regex/__init__.pyi

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,64 @@
1-
from .regex import *
1+
from ._main import *
2+
3+
# Sync with regex._main.__all__
4+
__all__ = [
5+
"cache_all",
6+
"compile",
7+
"DEFAULT_VERSION",
8+
"escape",
9+
"findall",
10+
"finditer",
11+
"fullmatch",
12+
"match",
13+
"purge",
14+
"search",
15+
"split",
16+
"splititer",
17+
"sub",
18+
"subf",
19+
"subfn",
20+
"subn",
21+
"template",
22+
"Scanner",
23+
"A",
24+
"ASCII",
25+
"B",
26+
"BESTMATCH",
27+
"D",
28+
"DEBUG",
29+
"E",
30+
"ENHANCEMATCH",
31+
"S",
32+
"DOTALL",
33+
"F",
34+
"FULLCASE",
35+
"I",
36+
"IGNORECASE",
37+
"L",
38+
"LOCALE",
39+
"M",
40+
"MULTILINE",
41+
"P",
42+
"POSIX",
43+
"R",
44+
"REVERSE",
45+
"T",
46+
"TEMPLATE",
47+
"U",
48+
"UNICODE",
49+
"V0",
50+
"VERSION0",
51+
"V1",
52+
"VERSION1",
53+
"X",
54+
"VERBOSE",
55+
"W",
56+
"WORD",
57+
"error",
58+
"Regex",
59+
"__version__",
60+
"__doc__",
61+
"RegexFlag",
62+
"Pattern",
63+
"Match",
64+
]

stubs/regex/regex/regex.pyi renamed to stubs/regex/regex/_main.pyi

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,69 @@ _T = TypeVar("_T")
1111

1212
__version__: str
1313

14+
# Sync with regex.__init__.__all__
15+
__all__ = [
16+
"cache_all",
17+
"compile",
18+
"DEFAULT_VERSION",
19+
"escape",
20+
"findall",
21+
"finditer",
22+
"fullmatch",
23+
"match",
24+
"purge",
25+
"search",
26+
"split",
27+
"splititer",
28+
"sub",
29+
"subf",
30+
"subfn",
31+
"subn",
32+
"template",
33+
"Scanner",
34+
"A",
35+
"ASCII",
36+
"B",
37+
"BESTMATCH",
38+
"D",
39+
"DEBUG",
40+
"E",
41+
"ENHANCEMATCH",
42+
"S",
43+
"DOTALL",
44+
"F",
45+
"FULLCASE",
46+
"I",
47+
"IGNORECASE",
48+
"L",
49+
"LOCALE",
50+
"M",
51+
"MULTILINE",
52+
"P",
53+
"POSIX",
54+
"R",
55+
"REVERSE",
56+
"T",
57+
"TEMPLATE",
58+
"U",
59+
"UNICODE",
60+
"V0",
61+
"VERSION0",
62+
"V1",
63+
"VERSION1",
64+
"X",
65+
"VERBOSE",
66+
"W",
67+
"WORD",
68+
"error",
69+
"Regex",
70+
"__version__",
71+
"__doc__",
72+
"RegexFlag",
73+
"Pattern",
74+
"Match",
75+
]
76+
1477
def compile(
1578
pattern: AnyStr | Pattern[AnyStr],
1679
flags: int = 0,
@@ -312,6 +375,9 @@ def cache_all(value: bool = True) -> None: ...
312375
@overload
313376
def cache_all(value: None) -> bool: ...
314377
def escape(pattern: AnyStr, special_only: bool = True, literal_spaces: bool = False) -> AnyStr: ...
378+
379+
DEFAULT_VERSION = RegexFlag.VERSION0
380+
315381
def template(pattern: AnyStr | Pattern[AnyStr], flags: int = 0) -> Pattern[AnyStr]: ...
316382

317383
Regex = compile

stubs/regex/regex/_regex.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import Any, AnyStr, Generic, final
77
from typing_extensions import Self
88

9-
from .regex import Match, Pattern
9+
from ._main import Match, Pattern
1010

1111
@final
1212
class Splitter(Generic[AnyStr]):

stubs/regex/regex/_regex_core.pyi

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,47 @@ from collections.abc import Callable
33
from typing import Any, AnyStr, Generic
44
from typing_extensions import TypeAlias
55

6-
from .regex import Pattern
6+
from ._main import Pattern
7+
8+
__all__ = [
9+
"A",
10+
"ASCII",
11+
"B",
12+
"BESTMATCH",
13+
"D",
14+
"DEBUG",
15+
"E",
16+
"ENHANCEMATCH",
17+
"F",
18+
"FULLCASE",
19+
"I",
20+
"IGNORECASE",
21+
"L",
22+
"LOCALE",
23+
"M",
24+
"MULTILINE",
25+
"P",
26+
"POSIX",
27+
"R",
28+
"REVERSE",
29+
"S",
30+
"DOTALL",
31+
"T",
32+
"TEMPLATE",
33+
"U",
34+
"UNICODE",
35+
"V0",
36+
"VERSION0",
37+
"V1",
38+
"VERSION1",
39+
"W",
40+
"WORD",
41+
"X",
42+
"VERBOSE",
43+
"error",
44+
"Scanner",
45+
"RegexFlag",
46+
]
747

848
class error(Exception):
949
def __init__(self, message: str, pattern: AnyStr | None = None, pos: int | None = None) -> None: ...
@@ -44,42 +84,42 @@ class RegexFlag(enum.IntFlag):
4484
X = 0x40
4585
VERBOSE = X
4686

47-
A = RegexFlag.A
4887
ASCII = RegexFlag.ASCII
49-
B = RegexFlag.B
5088
BESTMATCH = RegexFlag.BESTMATCH
51-
D = RegexFlag.D
5289
DEBUG = RegexFlag.DEBUG
53-
E = RegexFlag.E
5490
ENHANCEMATCH = RegexFlag.ENHANCEMATCH
55-
F = RegexFlag.F
5691
FULLCASE = RegexFlag.FULLCASE
57-
I = RegexFlag.I
5892
IGNORECASE = RegexFlag.IGNORECASE
59-
L = RegexFlag.L
6093
LOCALE = RegexFlag.LOCALE
61-
M = RegexFlag.M
6294
MULTILINE = RegexFlag.MULTILINE
63-
P = RegexFlag.P
6495
POSIX = RegexFlag.POSIX
65-
R = RegexFlag.R
6696
REVERSE = RegexFlag.REVERSE
67-
T = RegexFlag.T
6897
TEMPLATE = RegexFlag.TEMPLATE
69-
S = RegexFlag.S
7098
DOTALL = RegexFlag.DOTALL
71-
U = RegexFlag.U
7299
UNICODE = RegexFlag.UNICODE
73-
V0 = RegexFlag.V0
100+
VERBOSE = RegexFlag.VERBOSE
74101
VERSION0 = RegexFlag.VERSION0
75-
V1 = RegexFlag.V1
76102
VERSION1 = RegexFlag.VERSION1
77-
W = RegexFlag.W
78103
WORD = RegexFlag.WORD
104+
A = RegexFlag.A
105+
B = RegexFlag.B
106+
D = RegexFlag.D
107+
E = RegexFlag.E
108+
F = RegexFlag.F
109+
I = RegexFlag.I
110+
L = RegexFlag.L
111+
M = RegexFlag.M
112+
P = RegexFlag.P
113+
R = RegexFlag.R
114+
S = RegexFlag.S
115+
U = RegexFlag.U
116+
V0 = RegexFlag.V0
117+
V1 = RegexFlag.V1
118+
W = RegexFlag.W
79119
X = RegexFlag.X
80-
VERBOSE = RegexFlag.VERBOSE
120+
T = RegexFlag.T
81121

82-
DEFAULT_VERSION: RegexFlag
122+
DEFAULT_VERSION = VERSION1
83123

84124
_Lexicon: TypeAlias = list[tuple[AnyStr, Callable[[Scanner[AnyStr], AnyStr], Any]]]
85125

0 commit comments

Comments
 (0)