Companion

object Companion

Functions

Link copied to clipboard
fun errorQuark(): <Error class: unknown class>
Link copied to clipboard
fun escapeNul(string: String, length: <Error class: unknown class>): String

Escapes the nul characters in @string to "\x00". It can be used to compile a regex with embedded nul characters.

Link copied to clipboard
fun escapeString(string: String, length: <Error class: unknown class>): String

Escapes the special characters used for regular expressions in @string, for instance "a.b*c" becomes "a\.b\*c". This function is useful to dynamically generate regular expressions.

Link copied to clipboard
fun getType(): <Error class: unknown class>

Get the GType of Regex

Link copied to clipboard
fun matchSimple(pattern: String, string: String, compileOptions: RegexCompileFlags, matchOptions: RegexMatchFlags): Boolean

Scans for a match in @string for @pattern.

Link copied to clipboard
fun new(pattern: String, compileOptions: RegexCompileFlags, matchOptions: RegexMatchFlags): <Error class: unknown class><Regex?>

Compiles the regular expression to an internal form, and does the initial setup of the #GRegex structure.

Link copied to clipboard
fun splitSimple(pattern: String, string: String, compileOptions: RegexCompileFlags, matchOptions: RegexMatchFlags): List<String>

Breaks the string on the pattern, and returns an array of the tokens. If the pattern contains capturing parentheses, then the text for each of the substrings will also be returned. If the pattern does not match anywhere in the string, then the whole string is returned as the first token.