Regex#

class Regex(**kwargs)#
Constructors:

new(pattern:str, compile_options:GLib.RegexCompileFlags, match_options:GLib.RegexMatchFlags) -> GLib.Regex or None

Constructors#

class Regex
classmethod new(pattern: str, compile_options: RegexCompileFlags, match_options: RegexMatchFlags) Regex | None#
Parameters:
  • pattern

  • compile_options

  • match_options

Methods#

class Regex
classmethod check_replacement() Tuple[bool, bool]#
classmethod error_quark() int#
classmethod escape_nul(length: int) str#
Parameters:

length

classmethod escape_string(length: int) str#
Parameters:

length

get_capture_count() int#
get_compile_flags() RegexCompileFlags#
get_has_cr_or_lf() bool#
get_match_flags() RegexMatchFlags#
get_max_backref() int#
get_max_lookbehind() int#
get_pattern() str#
get_string_number(name: str) int#
Parameters:

name

match(string: str, match_options: RegexMatchFlags) Tuple[bool, MatchInfo]#
Parameters:
  • string

  • match_options

match_all(string: str, match_options: RegexMatchFlags) Tuple[bool, MatchInfo]#
Parameters:
  • string

  • match_options

match_all_full(string: list[str], start_position: int, match_options: RegexMatchFlags) Tuple[bool, MatchInfo]#
Parameters:
  • string

  • start_position

  • match_options

match_full(string: list[str], start_position: int, match_options: RegexMatchFlags) Tuple[bool, MatchInfo]#
Parameters:
  • string

  • start_position

  • match_options

classmethod match_simple(string: str, compile_options: RegexCompileFlags, match_options: RegexMatchFlags) bool#
Parameters:
  • string

  • compile_options

  • match_options

replace(string: list[str], start_position: int, replacement: str, match_options: RegexMatchFlags) str#
Parameters:
  • string

  • start_position

  • replacement

  • match_options

replace_eval(string: list[str], start_position: int, match_options: RegexMatchFlags, eval: Callable[[MatchInfo, String, Any], bool], user_data: Any = None) str#
Parameters:
  • string

  • start_position

  • match_options

  • eval

  • user_data

replace_literal(string: list[str], start_position: int, replacement: str, match_options: RegexMatchFlags) str#
Parameters:
  • string

  • start_position

  • replacement

  • match_options

split(string: str, match_options: RegexMatchFlags) list[str]#
Parameters:
  • string

  • match_options

split_full(string: list[str], start_position: int, match_options: RegexMatchFlags, max_tokens: int) list[str]#
Parameters:
  • string

  • start_position

  • match_options

  • max_tokens

classmethod split_simple(string: str, compile_options: RegexCompileFlags, match_options: RegexMatchFlags) list[str]#
Parameters:
  • string

  • compile_options

  • match_options