erg/crates/erg_compiler/lib/pystd/re.d.er
2023-02-17 15:15:11 +09:00

50 lines
1.9 KiB
Python

.RegexFlag: ClassType
.A: .RegexFlag
.ASCII: .RegexFlag
.DEBUG: .RegexFlag
.I: .RegexFlag
.IGNORECASE: .RegexFlag
.L: .RegexFlag
.LOCALE: .RegexFlag
.M: .RegexFlag
.MULTILINE: .RegexFlag
.NOFLAG: .RegexFlag
.S: .RegexFlag
.DOTALL: .RegexFlag
.X: .RegexFlag
.VERBOSE: .RegexFlag
.Match: ClassType
.Match.
expand: (self: .Match, template: Str) -> Str
# TODO: tuple
group: (self: .Match, x := Int or Str) -> Str
__getitem__: (self: .Match, x := Int or Str) -> Str
.Pattern: ClassType
.Pattern.
search: (self: .Pattern, string: Str) -> .Match or NoneType
match: (self: .Pattern, string: Str) -> .Match or NoneType
fullmatch: (self: .Pattern, string: Str) -> .Match or NoneType
split: (self: .Pattern, string: Str, maxspilit := Nat) -> [Str; _]
findall: (self: .Pattern, string: Str) -> [Str; _]
# TODO: iterator
finditer: (self: .Pattern, string: Str) -> [.Match; _]
sub: (self: .Pattern, repl: Str, string: Str, count := Nat) -> Str
subn: (self: .Pattern, repl: Str, string: Str, count := Nat) -> (Str, Nat)
flags: Nat
groups: Nat
pattern: Str
.compile: (pattern: Str, flags := Nat or .RegexFlag) -> .Pattern
.search: (pattern: Str, string: Str, flags := Nat or .RegexFlag) -> .Match or NoneType
.match: (pattern: Str, string: Str, flags := Nat or .RegexFlag) -> .Match or NoneType
.fullmatch: (pattern: Str, string: Str, flags := Nat or .RegexFlag) -> .Match or NoneType
.split: (pattern: Str, string: Str, maxspilit := Nat, flags := Nat or .RegexFlag) -> [Str; _]
.findall: (pattern: Str, string: Str, flags := Nat or .RegexFlag) -> [Str; _]
# TODO: iterator
.finditer: (pattern: Str, string: Str, flags := Nat or .RegexFlag) -> [.Match; _]
.sub: (pattern: Str, repl: Str, string: Str, count := Nat, flags := Nat or .RegexFlag) -> Str
.subn: (pattern: Str, repl: Str, string: Str, count := Nat, flags := Nat or .RegexFlag) -> (Str, Nat)
.escape: (pattern: Str) -> Str
.purge!: () => ()