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)
function seq_re_match_one
@pure @C
seq_re_match_one(re: cobj, anchor: int, string: bytes, pos: int, endpos: int)
function seq_re_pattern_groups
@pure @C
seq_re_pattern_groups(re: cobj)
function seq_re_group_name_to_index
@pure @C
seq_re_group_name_to_index(re: cobj, name: bytes)
function seq_re_group_index_to_name
@pure @C
seq_re_group_index_to_name(re: cobj, index: int)
function seq_re_pattern_error
@pure @C
seq_re_pattern_error(re: cobj)
function seq_re_escape
@pure @C
seq_re_escape(pattern: bytes)
function seq_re_purge
@C
seq_re_purge()
function seq_re_compile
@pure @C
seq_re_compile(pattern: bytes, flags: int, is_bytes: bool)
class error
class error
Fields 1
pattern str
Constructors 1
__init__
__init__(self, message: str = "", pattern: str = "")
Properties 1
msg
@property
msg(self)
function compile
compile(pattern: str, flags: int = 0)
@overload
compile(pattern: bytes, flags: int = 0)
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)
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)
lastgroup
@property
lastgroup(self)
Methods 7
group
group(self, *args)
start
start(self, group = 0)
end
end(self, group = 0)
span
span(self, group = 0)
expand
expand(self, template: str)
groups
groups(self, default: Optional[str] = None)
groupdict
groupdict(self, default: Optional[str] = None)
Special methods 4
__getitem__
__getitem__(self, g)
__copy__
__copy__(self)
__deepcopy__
__deepcopy__(self)
__bool__
__bool__(self)
class Pattern
@extend
class Pattern[T]
Properties 2
groups
@property
groups(self)
groupindex
@property
groupindex(self)
Methods 8
match
match(self, string: T, pos: Optional[int] = None, endpos: Optional[int] = None)
fullmatch
fullmatch(self, string: T, pos: Optional[int] = None, endpos: Optional[int] = None)
finditer
finditer(self, string: T, pos: Optional[int] = None, endpos: Optional[int] = None)
findall
findall(self, string: T, pos: Optional[int] = None, endpos: Optional[int] = None)
split
split(self, string: T, maxsplit: int = 0)
subn
subn(self, repl, string: T, count: int = 0)
sub
sub(self, repl, string: T, count: int = 0)
Special methods 1
__bool__
__bool__(self)