mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
48 lines
1.9 KiB
Python
48 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
|
|
.Match.group: (self: .Match, x := Int or Str) -> Str
|
|
.Match.__getitem__: (self: .Match, x := Int or Str) -> Str
|
|
|
|
.Pattern: ClassType
|
|
.Pattern.search: (self: .Pattern, string: Str) -> .Match or NoneType
|
|
.Pattern.match: (self: .Pattern, string: Str) -> .Match or NoneType
|
|
.Pattern.fullmatch: (self: .Pattern, string: Str) -> .Match or NoneType
|
|
.Pattern.split: (self: .Pattern, string: Str, maxspilit := Nat) -> [Str; _]
|
|
.Pattern.findall: (self: .Pattern, string: Str) -> [Str; _]
|
|
# TODO: iterator
|
|
.Pattern.finditer: (self: .Pattern, string: Str) -> [.Match; _]
|
|
.Pattern.sub: (self: .Pattern, repl: Str, string: Str, count := Nat) -> Str
|
|
.Pattern.subn: (self: .Pattern, repl: Str, string: Str, count := Nat) -> (Str, Nat)
|
|
.Pattern.flags: Nat
|
|
.Pattern.groups: Nat
|
|
.Pattern.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!: () => ()
|