Skip to main content

re

Standard library Module View source
variable A
A: Literal[int] = (1 << 0)
variable ASCII
ASCII: Literal[int] = (1 << 0)
variable DEBUG
DEBUG: Literal[int] = (1 << 1)
variable I
I: Literal[int] = (1 << 2)
variable IGNORECASE
IGNORECASE: Literal[int] = (1 << 2)
variable L
L: Literal[int] = (1 << 3)
variable LOCALE
LOCALE: Literal[int] = (1 << 3)
variable M
M: Literal[int] = (1 << 4)
variable MULTILINE
MULTILINE: Literal[int] = (1 << 4)
variable S
S: Literal[int] = (1 << 5)
variable DOTALL
DOTALL: Literal[int] = (1 << 5)
variable X
X: Literal[int] = (1 << 6)
variable VERBOSE
VERBOSE: Literal[int] = (1 << 6)
function seq_re_match
@pure @C
seq_re_match(re: cobj, anchor: int, string: bytes, pos: int, endpos: int) -> Ptr[Span]
function seq_re_match_one
@pure @C
seq_re_match_one(re: cobj, anchor: int, string: bytes, pos: int, endpos: int) -> Span
function seq_re_pattern_groups
@pure @C
seq_re_pattern_groups(re: cobj) -> int
function seq_re_group_name_to_index
@pure @C
seq_re_group_name_to_index(re: cobj, name: bytes) -> int
function seq_re_group_index_to_name
@pure @C
seq_re_group_index_to_name(re: cobj, index: int) -> bytes
function seq_re_pattern_error
@pure @C
seq_re_pattern_error(re: cobj) -> bytes
function seq_re_escape
@pure @C
seq_re_escape(pattern: bytes) -> bytes
function seq_re_purge
@C
seq_re_purge() -> None
function seq_re_compile
@pure @C
seq_re_compile(pattern: bytes, flags: int, is_bytes: bool) -> cobj
class error
class error(Exception)
Fields 1
pattern str
Constructors 1
__init__
__init__(self: Self, message: str = "", pattern: str = "")
Properties 1
msg
@property
msg(self: Self)
function compile
compile(pattern: str, flags: int = 0) -> Pattern[str]
@overload
compile(pattern: bytes, flags: int = 0) -> Pattern[bytes]
function match
match(pattern: str, string: str, flags: int = 0)
@overload
match(pattern: bytes, string: bytes, flags: int = 0)
function fullmatch
fullmatch(pattern: str, string: str, flags: int = 0)
@overload
fullmatch(pattern: bytes, string: bytes, flags: int = 0)
function finditer
finditer(pattern: str, string: str, flags: int = 0)
@overload
finditer(pattern: bytes, string: bytes, flags: int = 0) -> Generator[Match[bytes]]
function findall
findall(pattern: str, string: str, flags: int = 0)
@overload
findall(pattern: bytes, string: bytes, flags: int = 0)
function split
split(pattern: str, string: str, maxsplit: int = 0, flags: int = 0)
@overload
split(pattern: bytes, string: bytes, maxsplit: int = 0, flags: int = 0)
function sub
sub(pattern: str, repl, string: str, count: int = 0, flags: int = 0)
@overload
sub(pattern: bytes, repl, string: bytes, count: int = 0, flags: int = 0)
function subn
subn(pattern: str, repl, string: str, count: int = 0, flags: int = 0)
@overload
subn(pattern: bytes, repl, string: bytes, count: int = 0, flags: int = 0)
function escape
escape(pattern: str)
@overload
escape(pattern: bytes)
function purge
purge()
class Match
@tuple
class Match[T]
Fields 5
pos int
endpos int
re Pattern[T]
string T
T type
Properties 2
lastindex
@property
lastindex(self: Self)
lastgroup
@property
lastgroup(self: Self)
Methods 7
group
group(self: Self, /, *args)
start
start(self: Self, group = 0, /)
end
end(self: Self, group = 0, /)
span
span(self: Self, group = 0, /)
expand
expand(self: Self, /, template: str)
groups
groups(self: Self, /, default: Optional[str] = None)
groupdict
groupdict(self: Self, /, default: Optional[str] = None)
Special methods 4
__getitem__
__getitem__(self: Self, g, /)
__copy__
__copy__(self: Self, /)
__deepcopy__
__deepcopy__(self: Self, /)
__bool__
__bool__(self: Self)
class Pattern
@extend
class Pattern[T]
Properties 2
groups
@property
groups(self: Self)
groupindex
@property
groupindex(self: Self)
Methods 8
match
match(self: Self, /, string: T, pos: Optional[int] = None, endpos: Optional[int] = None) -> Optional[Match[T]]
fullmatch
fullmatch(self: Self, /, string: T, pos: Optional[int] = None, endpos: Optional[int] = None) -> Optional[Match[T]]
finditer
finditer(self: Self, /, string: T, pos: Optional[int] = None, endpos: Optional[int] = None) -> Generator[Match[T]]
findall
findall(self: Self, /, string: T, pos: Optional[int] = None, endpos: Optional[int] = None)
split
split(self: Self, /, string: T, maxsplit: int = 0)
subn
subn(self: Self, /, repl, string: T, count: int = 0)
sub
sub(self: Self, /, repl, string: T, count: int = 0)
Special methods 1
__bool__
__bool__(self: Self)