Regex.replaceLiteral

string replaceLiteral(string string_, int startPosition, string replacement, glib.types.RegexMatchFlags matchOptions)

Replaces all occurrences of the pattern in regex with the replacement text. replacement is replaced literally, to include backreferences use [glib.regex.Regex.replace].

Setting start_position differs from just passing over a shortened string and setting G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b".

Parameters

string_the string to perform matches against
startPositionstarting index of the string to match, in bytes
replacementtext to replace each match with
matchOptionsoptions for the match

Returns

a newly allocated string containing the replacements

Throws

[RegexException]